diff --git a/example/bin/.gitignore b/example/bin/.gitignore index e2b3e9d..44fbbc9 100644 --- a/example/bin/.gitignore +++ b/example/bin/.gitignore @@ -1,3 +1,4 @@ *.app data/*.jpg data/settings.xml +data/surfaces.xml diff --git a/example/bin/data/surfaces.xml b/example/bin/data/defaultSurfaces.xml similarity index 100% rename from example/bin/data/surfaces.xml rename to example/bin/data/defaultSurfaces.xml diff --git a/example/src/ofApp.cpp b/example/src/ofApp.cpp index dd3132e..fc1fc8f 100644 --- a/example/src/ofApp.cpp +++ b/example/src/ofApp.cpp @@ -14,7 +14,14 @@ void ofApp::setup() surfaceManager.getSurface(1)->setVertex(2, ofVec2f(300, 400)); */ - surfaceManager.loadXmlSettings("surfaces.xml"); + // check if the surfaces.xml file is there + // if not - load defaultSurfaces.xml + + if ( ofFile::doesFileExist("surfaces.xml") ) { + surfaceManager.loadXmlSettings("surfaces.xml"); + } else { + surfaceManager.loadXmlSettings("defaultSurfaces.xml"); + } gui.setSurfaceManager( &surfaceManager ); }