46 lines
832 B
C++
46 lines
832 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <memory>
|
|
|
|
#include "Window.h"
|
|
#include "PaintEvent.h"
|
|
#include "MouseEvent.h"
|
|
#include "KeyboardEvent.h"
|
|
|
|
class WindowManager
|
|
{
|
|
public:
|
|
WindowManager();
|
|
|
|
~WindowManager();
|
|
|
|
static std::unique_ptr<WindowManager> Create();
|
|
|
|
void AddWindow(WindowUPtr window);
|
|
|
|
mt::Window* GetMainWindow() const;
|
|
|
|
void OnPaintEvent(const PaintEvent* event);
|
|
|
|
void OnMouseEvent(const MouseEvent* event);
|
|
|
|
void OnKeyboardEvent(const KeyboardEvent* event);
|
|
|
|
void clearPlatformWindows();
|
|
|
|
std::size_t getNumWindows() const
|
|
{
|
|
return mWindows.size();
|
|
}
|
|
|
|
mt::Window* getWindow(std::size_t idx) const
|
|
{
|
|
return mWindows[idx].get();
|
|
}
|
|
|
|
private:
|
|
std::vector<WindowUPtr> mWindows;
|
|
};
|
|
|
|
using WindowManagerUPtr = std::unique_ptr<WindowManager>;
|