//======================================================================== int main( ) { ofGLFWWindowSettings settings; settings.width = 700; settings.height = 800; settings.setPosition(ofVec2f(0,0)); settings.resizable = false; shared_ptr<ofAppBaseWindow> guiWindow = ofCreateWindow(settings); settings.width = 1280; // 1920 settings.height = 720; // 1080 settings.resizable = true; settings.setPosition( ofVec2f(1440, 0 )); // settings.windowMode = OF_FULLSCREEN; shared_ptr<ofAppBaseWindow> mainWindow = ofCreateWindow(settings); shared_ptr<GuiApp> guiApp(new GuiApp); shared_ptr<ofApp> mainApp(new ofApp); mainApp->gui = guiApp; ofRunApp(mainWindow, mainApp); ofRunApp(guiWindow, guiApp); ofRunMainLoop(); }
//======================================================================== int main( ){ ofGLFWWindowSettings settings; settings.width = 600; settings.height = 600; settings.setPosition(ofVec2f(300,0)); settings.resizable = true; settings.numSamples = 8; shared_ptr<ofAppBaseWindow> mainWindow = ofCreateWindow(settings); settings.width = 300; settings.height = 300; settings.setPosition(ofVec2f(0,0)); settings.resizable = false; settings.numSamples = 4; settings.shareContextWith = mainWindow; shared_ptr<ofAppBaseWindow> guiWindow = ofCreateWindow(settings); shared_ptr<ofApp> mainApp(new ofApp); shared_ptr<GuiApp> guiApp(new GuiApp); mainApp->gui = guiApp; mainApp->window = mainWindow; mainApp->gl = dynamic_pointer_cast<ofBaseGLRenderer>(mainWindow->renderer()); ofRunApp(guiWindow, guiApp); ofRunApp(mainWindow, mainApp); ofRunMainLoop(); }
//======================================================================== int main( ){ // ofInit(); ofGLFWWindowSettings settings; settings.setSize(600, 600); settings.setPosition(ofVec2f(400, 40)); settings.resizable = true; settings.numSamples = 8; ofMainLoop mainLoop; auto mainWindow = mainLoop.createWindow(settings); shared_ptr<ofApp> mainApp(new ofApp); mainApp->window = mainWindow; mainApp->gl = static_pointer_cast<ofGLRenderer>(mainWindow->renderer()); mainLoop.run(mainWindow, mainApp); //------------------------------- settings.setSize(300, 300); settings.setPosition(ofVec2f(100, 40)); settings.resizable = true; settings.numSamples = 8; ofMainLoop guiLoop; auto guiWindow = guiLoop.createWindow(settings); shared_ptr<GuiApp> guiApp(new GuiApp); guiApp->window = guiWindow; guiApp->gl = static_pointer_cast<ofGLRenderer>(guiWindow->renderer()); guiLoop.run(guiWindow, guiApp); //------------------------------- while (!mainWindow->getWindowShouldClose()) { guiLoop.loopOnce(); ofAppGLFWWindow::pollEvents(); mainLoop.loopOnce(); ofAppGLFWWindow::pollEvents(); } }
//======================================================================== int main( ){ ofGLFWWindowSettings settings; settings.setSize(600, 600); settings.setPosition(ofVec2f(300,0)); settings.resizable = true; shared_ptr<ofAppBaseWindow> mainWindow = ofCreateWindow(settings); settings.setSize(300, 300); settings.setPosition(ofVec2f(0,0)); settings.resizable = false; shared_ptr<ofAppBaseWindow> guiWindow = ofCreateWindow(settings); shared_ptr<ofApp> mainApp(new ofApp); shared_ptr<GuiApp> guiApp(new GuiApp); mainApp->gui = guiApp; ofRunApp(guiWindow, guiApp); ofRunApp(mainWindow, mainApp); ofRunMainLoop(); }