File tree Expand file tree Collapse file tree 2 files changed +16
-18
lines changed
Expand file tree Collapse file tree 2 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -68,23 +68,6 @@ std::shared_ptr<ofAppBaseWindow> ofMainLoop::createWindow(const ofWindowSettings
6868 return window;
6969}
7070
71- template <typename Window>
72- void ofMainLoop::addWindow (const std::shared_ptr<Window> & window){
73- allowMultiWindow = Window::allowsMultiWindow ();
74- if (Window::doesLoop ()){
75- windowLoop = Window::loop;
76- }
77- if (Window::needsPolling ()){
78- windowPollEvents = Window::pollEvents;
79- }
80- if (!allowMultiWindow){
81- windowsApps.clear ();
82- }
83- windowsApps[window] = std::shared_ptr<ofBaseApp>();
84- currentWindow = window;
85- ofAddListener (window->events ().keyPressed ,this ,&ofMainLoop::keyPressed);
86- }
87-
8871void ofMainLoop::run (const std::shared_ptr<ofAppBaseWindow> & window, std::shared_ptr<ofBaseApp> && app){
8972 windowsApps[window] = app;
9073 if (app){
Original file line number Diff line number Diff line change @@ -13,8 +13,23 @@ class ofMainLoop {
1313 virtual ~ofMainLoop ();
1414
1515 std::shared_ptr<ofAppBaseWindow> createWindow (const ofWindowSettings & settings);
16+
1617 template <typename Window>
17- void addWindow (const std::shared_ptr<Window> & window);
18+ void addWindow (const std::shared_ptr<Window> & window){
19+ allowMultiWindow = Window::allowsMultiWindow ();
20+ if (Window::doesLoop ()){
21+ windowLoop = Window::loop;
22+ }
23+ if (Window::needsPolling ()){
24+ windowPollEvents = Window::pollEvents;
25+ }
26+ if (!allowMultiWindow){
27+ windowsApps.clear ();
28+ }
29+ windowsApps[window] = std::shared_ptr<ofBaseApp>();
30+ currentWindow = window;
31+ ofAddListener (window->events ().keyPressed ,this ,&ofMainLoop::keyPressed);
32+ }
1833
1934 void run (const std::shared_ptr<ofAppBaseWindow> & window, std::shared_ptr<ofBaseApp> && app);
2035 void run (std::shared_ptr<ofBaseApp> && app);
You can’t perform that action at this time.
0 commit comments