2020-02-25 00:44:40 +01:00
|
|
|
#include "WindowManager.h"
|
2023-01-29 18:58:59 +01:00
|
|
|
#include "Graphics/Graphics.h"
|
2020-02-25 00:44:40 +01:00
|
|
|
|
2021-09-29 22:12:56 +02:00
|
|
|
using namespace Seele;
|
|
|
|
|
|
2024-06-09 12:20:04 +02:00
|
|
|
WindowManager::WindowManager() {}
|
2020-02-25 00:44:40 +01:00
|
|
|
|
2024-06-09 12:20:04 +02:00
|
|
|
WindowManager::~WindowManager() {}
|
2020-03-05 11:43:38 +01:00
|
|
|
|
2024-06-09 12:20:04 +02:00
|
|
|
OWindow WindowManager::addWindow(Gfx::PGraphics graphics, const WindowCreateInfo& createInfo) {
|
2023-11-08 23:27:21 +01:00
|
|
|
OWindow window = new Window(this, graphics->createWindow(createInfo));
|
2023-12-02 10:55:00 +01:00
|
|
|
windows.add(window);
|
|
|
|
|
return window;
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-09 12:20:04 +02:00
|
|
|
void WindowManager::render() {
|
|
|
|
|
for (auto& window : windows) {
|
2023-12-28 21:42:18 +01:00
|
|
|
window->pollInputs();
|
|
|
|
|
if (window->isPaused())
|
|
|
|
|
continue;
|
2023-12-02 10:55:00 +01:00
|
|
|
window->render();
|
|
|
|
|
}
|
2021-11-01 20:25:16 +01:00
|
|
|
}
|
|
|
|
|
|
2024-06-09 12:20:04 +02:00
|
|
|
void WindowManager::notifyWindowClosed(PWindow window) { windows.remove(window); }
|