From 7641fad8ebc4ba0e6412fcb7a556a705c0a6ea2c Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 5 Jan 2012 00:02:13 +0000 Subject: viewport objectified --- src/main.cpp | 2 +- src/testApp.cpp | 30 +++++++++++++++++++++--------- src/testApp.h | 1 + src/viewpoint.cpp | 10 +++++----- 4 files changed, 28 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 1ed640d..ac9bc8c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,7 +21,7 @@ int main( ){ ofAppGlutWindow window; - ofSetupOpenGL(&window, 512,512, OF_WINDOW); // <-------- setup the GL context + ofSetupOpenGL(&window, 800,400, OF_WINDOW); // <-------- setup the GL context glutIgnoreKeyRepeat(1); glutSetKeyRepeat(GLUT_KEY_REPEAT_OFF); //these don't work!!! printf("key repeat ignore: %i\n",glutDeviceGet(GLUT_DEVICE_IGNORE_KEY_REPEAT)); diff --git a/src/testApp.cpp b/src/testApp.cpp index 42f7055..7e448fd 100644 --- a/src/testApp.cpp +++ b/src/testApp.cpp @@ -25,10 +25,12 @@ void testApp::setup(){ mode=CALIBRATE; - views=new viewpoint[1]; + views=new viewpoint[2]; //todo: read this from xml - views[0].setup(ofGetWidth(),ofGetHeight(),0,0); + numViews=2; + views[0].setup(ofGetWidth()/2,ofGetHeight(),0,0); + views[1].setup(ofGetWidth()/2,ofGetHeight(),ofGetWidth()/2,0); activeView=0; } @@ -39,9 +41,11 @@ void testApp::update(){ //-------------------------------------------------------------- void testApp::draw(){ - - views[0].setLight(); - views[0].begin(); + for (int i=0;i