// D:\Dev\Mosis\MosisService\designer\src\desktop_platform.h #pragma once #include "platform.h" #include "desktop_file_interface.h" // Forward declare GLFW types to avoid including glfw3.h here struct GLFWwindow; namespace mosis { class DesktopPlatform : public IPlatform { public: DesktopPlatform(GLFWwindow* window, uint32_t width, uint32_t height); ~DesktopPlatform() override = default; // IPlatform interface std::unique_ptr CreateGraphicsContext() override; std::unique_ptr CreateRenderTarget(uint32_t width, uint32_t height) override; Rml::FileInterface& GetFileInterface() override; void Log(const std::string& message) override; bool PollEvents() override; void SwapBuffers() override; uint32_t GetWidth() const override { return m_width; } uint32_t GetHeight() const override { return m_height; } void SetResolution(uint32_t width, uint32_t height) override; // Desktop-specific void SetAssetsPath(const std::string& path); GLFWwindow* GetWindow() const { return m_window; } private: GLFWwindow* m_window; uint32_t m_width; uint32_t m_height; DesktopFileInterface m_file_interface; }; // Desktop render target using FBO class DesktopRenderTarget : public IRenderTarget { public: DesktopRenderTarget() = default; ~DesktopRenderTarget() override; bool Create(uint32_t width, uint32_t height) override; void Bind() override; void Unbind() override; void Destroy() override; uint32_t GetFramebuffer() const override { return m_framebuffer; } uint32_t GetTexture() const override { return m_texture; } uint32_t GetWidth() const override { return m_width; } uint32_t GetHeight() const override { return m_height; } private: uint32_t m_framebuffer = 0; uint32_t m_texture = 0; uint32_t m_depth_buffer = 0; uint32_t m_width = 0; uint32_t m_height = 0; }; } // namespace mosis