From da594ca1416b6a6570c73dfce9029f5b7e2154a9 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Sat, 20 Feb 2016 21:48:25 +0100 Subject: [PATCH] Update example to use `Settings` singleton Add different way of entering fullscreen. Store -f in Settings and use `ofSetFullscreen()` during `ofApp::setup()` --- example/src/main.cpp | 10 ++++------ example/src/ofApp.cpp | 2 ++ example/src/ofApp.h | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/example/src/main.cpp b/example/src/main.cpp index d1b6467..e5733f9 100644 --- a/example/src/main.cpp +++ b/example/src/main.cpp @@ -2,6 +2,7 @@ #include "ofApp.h" #include #include +#include "Settings.h" int main(int argc, char * argv[]){ bool fullscreen = false; @@ -13,12 +14,9 @@ int main(int argc, char * argv[]){ break; } } + + Settings::instance()->setFullscreen(fullscreen); - if(fullscreen){ - ofSetupOpenGL(800, 450, OF_FULLSCREEN); - }else{ - ofSetupOpenGL(800, 450, OF_WINDOW); - } - + ofSetupOpenGL(800, 450, OF_WINDOW); ofRunApp(new ofApp()); } diff --git a/example/src/ofApp.cpp b/example/src/ofApp.cpp index 8e1bdc5..4d23486 100644 --- a/example/src/ofApp.cpp +++ b/example/src/ofApp.cpp @@ -19,6 +19,8 @@ void ofApp::setup(){ // The info layer is hidden by default, press to toggle // piMapper.showInfo(); + + ofSetFullscreen(Settings::instance()->getFullscreen()); } void ofApp::draw(){ diff --git a/example/src/ofApp.h b/example/src/ofApp.h index 54aabf8..8d4b93f 100644 --- a/example/src/ofApp.h +++ b/example/src/ofApp.h @@ -1,6 +1,7 @@ #pragma once #include "ofMain.h" +#include "Settings.h" #include "ofxPiMapper.h" #include "CustomSource.h" #include "CrossSource.h"