summaryrefslogtreecommitdiff
path: root/gui/src/main.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2018-02-02 18:12:41 +0000
committerTim Redfern <tim@getdrop.com>2018-02-02 18:12:41 +0000
commit645e8c6007bdacaf2f37019d871ce9d3281a280d (patch)
treedea64e9e78c9013f732edd2ce3604f31d694e8f7 /gui/src/main.cpp
parent7c50a03c5857310aa383b1ba89a18792c96724b1 (diff)
many changes
Diffstat (limited to 'gui/src/main.cpp')
-rw-r--r--gui/src/main.cpp37
1 files changed, 22 insertions, 15 deletions
diff --git a/gui/src/main.cpp b/gui/src/main.cpp
index ed7e18f..d8d06d3 100644
--- a/gui/src/main.cpp
+++ b/gui/src/main.cpp
@@ -8,17 +8,8 @@ int main(int argc, char *argv[]){
ofGLFWWindowSettings settings;
- settings.width = 600;
- settings.height = 1200;
- settings.setPosition(ofVec2f(0,0));
- settings.resizable = true;
-
- //settings.decorated = false; //doesn't suppress FS title bar
- shared_ptr<ofAppBaseWindow> guiWindow = ofCreateWindow(settings);
- guiWindow->setVerticalSync(false);
- // share OpenGL resources with other windows
- settings.shareContextWith = guiWindow;
+
settings.decorated = true;
settings.width = 1200;
@@ -29,14 +20,30 @@ int main(int argc, char *argv[]){
shared_ptr<ofAppBaseWindow> mainWindow = ofCreateWindow(settings);
mainWindow->setVerticalSync(false);
+ settings.width = 600;
+ settings.height = 1200;
+ settings.setPosition(ofVec2f(0,0));
+ settings.resizable = true;
+
+ // share OpenGL resources with other windows
+ settings.shareContextWith = mainWindow;
+
+ //settings.decorated = false; //doesn't suppress FS title bar
+ shared_ptr<ofAppBaseWindow> guiWindow = ofCreateWindow(settings);
+ guiWindow->setVerticalSync(false);
+
shared_ptr<ofApp> mainApp(new ofApp);
//mainApp->setupGui();
- ofAddListener(guiWindow->events().draw,mainApp.get(),&ofApp::drawGui);
- ofAddListener(guiWindow->events().windowResized,mainApp.get(),&ofApp::guiWindowResized);
- ofAddListener(guiWindow->events().keyPressed,mainApp.get(),&ofApp::guiKeyPressed);
-
- ofRunApp(mainWindow, mainApp);
+ ofAddListener(mainWindow->events().update,mainApp.get(),&ofApp::updateOutput);
+ ofAddListener(mainWindow->events().draw,mainApp.get(),&ofApp::drawOutput);
+ ofAddListener(mainWindow->events().windowResized,mainApp.get(),&ofApp::outputWindowResized);
+ ofAddListener(mainWindow->events().keyPressed,mainApp.get(),&ofApp::outputKeyPressed);
+ ofAddListener(mainWindow->events().mouseDragged,mainApp.get(),&ofApp::outputMouseDragged);
+ ofAddListener(mainWindow->events().mousePressed,mainApp.get(),&ofApp::outputMousePressed);
+ ofAddListener(mainWindow->events().mouseReleased,mainApp.get(),&ofApp::outputMouseReleased);
+
+ ofRunApp(guiWindow, mainApp);
ofRunMainLoop();
}
\ No newline at end of file