.. _program_listing_file_Source_Azura_RenderSystem_Inc_Generic_Window.h: Program Listing for File Window.h ================================= |exhale_lsh| :ref:`Return to documentation for file ` (``Source\Azura\RenderSystem\Inc\Generic\Window.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include "GenericTypes.h" #include "Types.h" #include "Renderer.h" #include "Core/Events.h" #include "Log/Log.h" namespace Azura { enum class CursorState { Visible, Hidden, Disabled }; enum class UpdateRate { RateUnlocked, Rate240, Rate120, Rate60, Rate30 }; class Window { public: virtual ~Window() = default; Window(String title, U32 width, U32 height); virtual const void* GetHandle() const; Window(const Window& other) = delete; Window(Window&& other) noexcept = delete; Window& operator=(const Window& other) = delete; Window& operator=(Window&& other) noexcept = delete; virtual bool Initialize() = 0; virtual void StartListening() = 0; void SetUpdateCallback(std::function eventUpdate); void SetMouseEventCallback(std::function eventFunc); void SetKeyEventCallback(std::function eventFunc); virtual void Destroy() = 0; virtual void SetCursorState(CursorState state) = 0; virtual void ResetCursor() = 0; ViewportDimensions GetViewport() const; void SetUpdateRate(UpdateRate rate); SwapChainRequirements GetSwapChainRequirements() const; U32 GetWidth() const; U32 GetHeight() const; protected: void SetHandle(void* window); const char* GetTitle() const; void CallUpdateFunction(float timeDelta) const; void CallMouseEventFunction(MouseEvent e) const; void CallKeyEventFunction(KeyEvent e) const; Log log_Window; float m_midWidth; float m_midHeight; UpdateRate m_rate; private: U32 m_width; U32 m_height; String m_title; void* p_windowResource; std::function p_updateFunc; std::function p_mouseEventFunc{nullptr}; std::function p_keyEventFunc{nullptr}; }; } // namespace Azura