From cd298b5bf00661ce31ae1d4498de58d5291477f2 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Tue, 22 May 2018 22:21:52 +0100 Subject: &%0%& content? --- gistanalysis/src/main.cpp | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) (limited to 'gistanalysis/src/main.cpp') diff --git a/gistanalysis/src/main.cpp b/gistanalysis/src/main.cpp index e57370b..1abb772 100644 --- a/gistanalysis/src/main.cpp +++ b/gistanalysis/src/main.cpp @@ -2,12 +2,46 @@ #include "ofApp.h" //======================================================================== -int main( ){ - ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context +int main(int argc, char *argv[]){ - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp(new ofApp()); + + ofGLFWWindowSettings settings; + + settings.decorated = true; + + settings.width = 1024; + settings.height = 768 ; + settings.setPosition(ofVec2f(1700,0)); + settings.resizable = false; + + shared_ptr mainWindow = ofCreateWindow(settings); + mainWindow->setVerticalSync(false); + + settings.width = 600; + settings.height = 900; + 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 guiWindow = ofCreateWindow(settings); + guiWindow->setVerticalSync(false); + + shared_ptr mainApp(new ofApp); + //mainApp->setupGui(); + + 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().keyReleased,mainApp.get(),&ofApp::outputKeyReleased); + 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(); } -- cgit v1.2.3