.. _program_listing_file_gui_Demeter_Renderer_Texture.hpp: Program Listing for File Texture.hpp ==================================== |exhale_lsh| :ref:`Return to documentation for file ` (``gui/Demeter/Renderer/Texture.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include "SDL2.hpp" struct Texture { private: std::unique_ptr surface = nullptr; GLenum format; GLuint texture = 0; void GenGLTexture(); public: Texture() = default; Texture(const Texture &) = delete; Texture &operator=(const Texture &) = delete; ~Texture(); bool Init(SDL2 &sdl, const std::string &path); [[nodiscard]] GLuint GetGL() const { return texture; } [[nodiscard]] GLsizei GetWidth() const { return surface->w; } [[nodiscard]] GLsizei GetHeight() const { return surface->h; } [[nodiscard]] const void *GetPixels() const { return surface->pixels; } [[nodiscard]] GLenum GetFormat() const { return format; } };