#ifndef __MLX_GRAPHICS__ #define __MLX_GRAPHICS__ #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); [[nodiscard]] MLX_FORCEINLINE int& GetID() noexcept { return m_id; } [[nodiscard]] inline std::shared_ptr GetWindow() { return p_window; } void Render() noexcept; inline void ResetRenderData() 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 TryEraseSpritesInScene(NonOwningPtr texture) noexcept; [[nodiscard]] MLX_FORCEINLINE bool HasWindow() const noexcept { return m_has_window; } [[nodiscard]] MLX_FORCEINLINE Renderer& GetRenderer() { return m_renderer; } ~GraphicsSupport(); private: Renderer m_renderer; SceneRenderer m_scene_renderer; std::shared_ptr p_window; std::unique_ptr p_scene; std::uint64_t m_current_depth = 0; std::size_t m_width = 0; std::size_t m_height = 0; int m_id; bool m_has_window; }; } #include #endif