summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp2
-rw-r--r--src/testApp.cpp23
-rw-r--r--src/testApp.h4
3 files changed, 16 insertions, 13 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a0adc83..15650ab 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -17,7 +17,7 @@
int main( ){
ofAppGlutWindow window;
- //ofSetupOpenGL(&window, 2048,768, OF_FULLSCREEN); // <-------- setup the GL context
+ //ofSetupOpenGL(&window, 1024,768, OF_FULLSCREEN); // <-------- setup the GL context
ofSetupOpenGL(&window, 1024,300, OF_WINDOW);
glutIgnoreKeyRepeat(1);
glutSetKeyRepeat(GLUT_KEY_REPEAT_OFF); //these don't work!!!
diff --git a/src/testApp.cpp b/src/testApp.cpp
index 37717fa..f8078fb 100644
--- a/src/testApp.cpp
+++ b/src/testApp.cpp
@@ -1,7 +1,7 @@
#include "testApp.h"
//--------------------------------------------------------------
testApp::~testApp(){
- saveSettings();
+ saveSettings("settings.xml");
}
//--------------------------------------------------------------
void testApp::setup(){
@@ -23,12 +23,12 @@ void testApp::setup(){
//ofDisableArbTex();
- texture.loadMovie("gradblend01.mov");
+ texture.loadMovie("stripey2.mov");
texture.play();
mode=CALIBRATE;
- loadSettings();
+ loadSettings("settings.xml");
light=true;
}
@@ -99,8 +99,10 @@ void testApp::keyPressed(int key){
activeView=1;
break;
case 'p':
- saveSettings();
- printf("saved settings.xml\n");
+ saveSettings("settings.xml");
+ break;
+ case 'z':
+ loadSettings("defaults.xml");
break;
case '/':
light=!light;
@@ -110,10 +112,10 @@ void testApp::keyPressed(int key){
}
}
-void testApp::loadSettings(){
+void testApp::loadSettings(string filename){
//viewport settings are float/ normalised to 0..1
- if( !XML.loadFile("settings.xml") ){
- printf("unable to load settings.xml check data/ folder\n");
+ if( !XML.loadFile(filename) ){
+ printf("unable to load %s check data/ folder\n",filename.c_str());
}else{
if(XML.pushTag("map4")) {
numViews=XML.getNumTags("view");
@@ -142,7 +144,7 @@ void testApp::loadSettings(){
//activeView=0;
}
//--------------------------------------------------------------
-void testApp::saveSettings(){
+void testApp::saveSettings(string filename){
//either re-navigate the whole thing OR
//save the number to the vp OR
//send a pointer to the vp
@@ -160,7 +162,8 @@ void testApp::saveSettings(){
}
XML.popTag();
}
- XML.saveFile("settings.xml");
+ XML.saveFile(filename);
+ printf("saved %s\n",filename.c_str());
}
//--------------------------------------------------------------
void testApp::keyReleased(int key){
diff --git a/src/testApp.h b/src/testApp.h
index 07c043f..d0710e2 100644
--- a/src/testApp.h
+++ b/src/testApp.h
@@ -39,8 +39,8 @@ class testApp : public ofBaseApp{
void update();
void draw();
- void loadSettings();
- void saveSettings();
+ void loadSettings(string filename);
+ void saveSettings(string filename);
void keyPressed (int key);
void keyReleased(int key);
void mouseMoved(int x, int y );