#pragma once #include "CComponent.h" #include "CRendererBase.h" #include "CCallbackHandler.h" #include "SDL3/SDL.h" #include "glm/glm.hpp" #include #include class CWindowManager : public CComponent { public: CWindowManager(); ~CWindowManager(); bool V_Init() override; void V_Update() override; void DestructWindow(); glm::ivec2 GetWindowSize(); float GetWindowAspect() const; void HandleEvent(const SDL_Event& event); DEFINE_SOL_USERTYPE(); bool V_ScriptInit(std::shared_ptr _state, sol::table table) override; static size_t GetWindowFlags(bool windowed, bool noborder, size_t generic_flag); SDL_Window* Window = nullptr; CCallbackHandler OnDraw; CCallbackHandler OnEventHandle; std::unique_ptr Renderer; DEFINE_COMPONENT(); private: void m_UpdateAspect(); SDL_Event m_Event; float m_aspect = 1.0f; };