#ifndef __MLX_GRAPHICS__ #define __MLX_GRAPHICS__ #include #include #include #include #include #include #include #include namespace mlx { class GraphicsSupport : public NonCopyable { public: GraphicsSupport(std::size_t w, std::size_t h, NonOwningPtr render_target, int id); GraphicsSupport(std::size_t w, std::size_t h, std::string title, int id); inline int& GetID() noexcept; inline std::shared_ptr GetWindow(); void Render() noexcept; inline void ClearRenderData() noexcept; inline void PixelPut(int x, int y, std::uint32_t color) noexcept; inline void StringPut(int x, int y, std::uint32_t color, std::string str); inline void TexturePut(NonOwningPtr texture, int x, int y); inline void LoadFont(const std::filesystem::path& filepath, float scale); inline void TryEraseTextureFromManager(NonOwningPtr texture) noexcept; inline bool HasWindow() const noexcept { return m_has_window; } inline Renderer& GetRenderer() { return m_renderer; } ~GraphicsSupport(); private: Renderer m_renderer; PixelPutPipeline m_pixel_put_pipeline; std::vector> m_drawlist; TextManager m_text_manager; TextureRegistry m_texture_registry; glm::mat4 m_proj = glm::mat4(1.0); std::shared_ptr p_window; std::size_t m_width = 0; std::size_t m_height = 0; int m_id; bool m_has_window; }; } #include #endif