Blame | Last modification | View Log | RSS feed
#include <iostream>
//#include <unistd.h>
#include <stdio.h>
#include <QTime>
#include <QTest>
#include "OpenGLContext.h"
#include "ProjectorOpenGL.h"
int main(){
// Get screeninfo for OpenGL projector
std::vector<ScreenInfo> screenInfo;
screenInfo = OpenGLContext::GetScreenInfo();
for (unsigned int i=0; i<screenInfo.size(); i++) {
printf("Screen %d: width %d, height %d\n", i, screenInfo[i].resX, screenInfo[i].resY);
}
// Fill stripe texture
unsigned char stripeImage[200][200][3];
for (int k=0; k<3; k++) {
for (int i = 0; i < 200; i++) {
for (int j = 0; j < 101; j++) {
stripeImage[i][j][k] = 50;
}
for (int j = 101; j < 200; j++) {
stripeImage[i][j][k] = 100;
}
}
}
// Fill gray texture
unsigned char grayImage[200][200][3];
for (int k=0; k<3; k++) {
for (int i = 0; i < 200; i++) {
for (int j = 0; j < 200; j++) {
grayImage[i][j][k] = 50;
}
}
}
QTime time; time.start();
ProjectorOpenGL *PP = new ProjectorOpenGL(1);
std::cout << "Displaying texture" << std::endl;
time.restart();
PP->displayTexture((unsigned char*)stripeImage, 200, 200);
QTest::qSleep(2000);
unsigned int msecelapsed = time.restart();
std::cout << msecelapsed << std::endl;
std::cout << "Displaying white and black..." << std::endl;
for(unsigned int i = 0; i<3000; i++){
time.restart();
PP->displayWhite();
PP->displayBlack();
unsigned int msecelapsed = time.restart();
std::cout << msecelapsed << std::endl;
}
// std::cout << "Defining pattern sequence..." << std::endl;
// PP->setPattern(0, (unsigned char*)stripeImage, 200, 200);
// PP->setPattern(1, (unsigned char*)grayImage, 200, 200);
// std::cout << "Cycling through pattern sequence..." << std::endl;
// for(unsigned int i = 0; i<10000; i++){
// time.restart();
// PP->displayPattern(i%2);
// //QTest::qSleep(500);
// unsigned int msecelapsed = time.restart();
// std::cout << msecelapsed << std::endl;
// }
delete PP;
return 0;
}