29 lines
589 B
C++
29 lines
589 B
C++
![]() |
#include "WindowManager.h"
|
||
|
|
||
|
|
||
|
WindowManager::WindowManager(GdkGLConfig *glconfig) {
|
||
|
this->glconfig = glconfig;
|
||
|
|
||
|
windows.push_back(new Window(glconfig, this));
|
||
|
}
|
||
|
|
||
|
WindowManager::~WindowManager() {
|
||
|
for(std::list<Window*>::iterator w = windows.begin(); w != windows.end(); w++)
|
||
|
delete *w;
|
||
|
}
|
||
|
|
||
|
void WindowManager::run() {
|
||
|
for(std::list<Window*>::iterator w = windows.begin(); w != windows.end(); w++)
|
||
|
(*w)->show();
|
||
|
|
||
|
gtk_main();
|
||
|
}
|
||
|
|
||
|
void WindowManager::windowClosed(Window *window) {
|
||
|
windows.remove(window);
|
||
|
delete window;
|
||
|
|
||
|
if(windows.empty())
|
||
|
gtk_main_quit();
|
||
|
}
|