-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathSLProjectorVirtual.cpp
More file actions
44 lines (34 loc) · 939 Bytes
/
SLProjectorVirtual.cpp
File metadata and controls
44 lines (34 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "SLProjectorVirtual.h"
#include <QTime>
#include <QTest>
SLProjectorVirtual::SLProjectorVirtual(unsigned int){
time = new QTime();
time->start();
}
void SLProjectorVirtual::waitForProjection(){
// Wait till 17 msec have elapsed on time
unsigned int elapsed = time->elapsed();
if(elapsed < 33)
QTest::qSleep(33 - elapsed);
// Reset time
time->restart();
}
void SLProjectorVirtual::displayPattern(unsigned int){
this->waitForProjection();
}
void SLProjectorVirtual::displayTexture(const unsigned char*, unsigned int, unsigned int){
this->waitForProjection();
}
void SLProjectorVirtual::displayBlack(){
this->waitForProjection();
}
void SLProjectorVirtual::displayWhite(){
this->waitForProjection();
}
void SLProjectorVirtual::getScreenRes(unsigned int *nx, unsigned int *ny){
*nx = 640;
*ny = 480;
}
SLProjectorVirtual::~SLProjectorVirtual(){
delete time;
}