/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* graphics.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/04/02 14:49:49 by maldavid #+# #+# */ /* Updated: 2023/12/08 19:04:59 by kbz_8 ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef __MLX_GRAPHICS__ #define __MLX_GRAPHICS__ #include #include #include #include #include #include #include #include #include #include #include #include namespace mlx { class GraphicsSupport : public non_copyable { public: GraphicsSupport(std::size_t w, std::size_t h, const std::string& title, int id); inline int& getID() noexcept; inline std::shared_ptr getWindow(); inline void beginRender() noexcept; void endRender() noexcept; inline void clearRenderData() noexcept; inline void pixelPut(int x, int y, uint32_t color) noexcept; inline void stringPut(int x, int y, int color, std::string str); inline void texturePut(Texture* texture, int x, int y); inline void loadFont(const std::filesystem::path& filepath, float scale); ~GraphicsSupport(); private: std::vector _textures_to_render; PixelPutPipeline _pixel_put_pipeline; glm::mat4 _proj = glm::mat4(1.0); std::shared_ptr _window; std::unique_ptr _text_put_pipeline; // unique_ptr because of the size of the class std::unique_ptr _renderer; int _id; }; } #include #endif