Skip to content

Commit 6ba9ee3

Browse files
authored
revert addWindow template (#7415)
#changelog #core
1 parent 97a16f9 commit 6ba9ee3

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

libs/openFrameworks/app/ofMainLoop.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff 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-
8871
void ofMainLoop::run(const std::shared_ptr<ofAppBaseWindow> & window, std::shared_ptr<ofBaseApp> && app){
8972
windowsApps[window] = app;
9073
if(app){

libs/openFrameworks/app/ofMainLoop.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)