From 19be92e0aff674b95bdae72fe7a2e409fd1bf77a Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Mon, 17 Apr 2023 19:44:00 +0100 Subject: add to archive --- FESgui/src/main.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 FESgui/src/main.cpp (limited to 'FESgui/src/main.cpp') diff --git a/FESgui/src/main.cpp b/FESgui/src/main.cpp new file mode 100644 index 0000000..226ae24 --- /dev/null +++ b/FESgui/src/main.cpp @@ -0,0 +1,46 @@ +#include "ofMain.h" +#include "ofApp.h" + + +//======================================================================== +int main(int argc, char *argv[]){ + + + ofGLFWWindowSettings settings; + + //settings.setGLVersion(3,2); if using kinect + + settings.decorated = true; + settings.setSize(outputWindowSize.x,outputWindowSize.y); + settings.setPosition(ofVec2f(1700,0)); + settings.resizable = false; + + shared_ptr mainWindow = ofCreateWindow(settings); + mainWindow->setVerticalSync(false); + + settings.setSize(1200,1100); + settings.setPosition(ofVec2f(0,20)); + settings.resizable = false; + + // share OpenGL resources with other windows + settings.shareContextWith = mainWindow; + + settings.decorated = true; //doesn't suppress FS title bar + shared_ptr guiWindow = ofCreateWindow(settings); + guiWindow->setVerticalSync(false); + + shared_ptr mainApp(new ofApp); + + 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(); +} + \ No newline at end of file -- cgit v1.2.3