2#ifdef StevEngine_RENDERER_GL
3#include "main/ResourceManager.hpp"
7namespace StevEngine::Visuals {
90 ComputeTexture(
const ComputeTexture& copy);
106 bool AttachToFrameBuffer(uint32_t framebuffer, GLenum attachmentType = GL_COLOR_ATTACHMENT0);
115 void*
RetrieveData(GLenum
format,
size_t dataSize =
sizeof(
float), GLenum pixel = GL_FLOAT)
const;
Container for loaded resource data.
Definition ResourceManager.hpp:11
const GLenum format
OpenGL image storage format.
Definition Texture.hpp:119
const uint32_t height
Height of the texture.
Definition Texture.hpp:118
void * RetrieveData(GLenum format, size_t dataSize=sizeof(float), GLenum pixel=GL_FLOAT) const
Retrieve pointer to the data from the texture.
Definition Texture.cpp:87
const uint32_t width
Width of the texture.
Definition Texture.hpp:117
bool AttachToFrameBuffer(uint32_t framebuffer, GLenum attachmentType=GL_COLOR_ATTACHMENT0)
Attach to an OpenGL framebuffer Generates and configures texture in GPU memory.
Definition Texture.cpp:74
void BindTexture(bool force=false)
Bind texture to OpenGL Generates and configures texture in GPU memory.
Definition Texture.cpp:60
SDL_Surface * surface
SDL surface containing image data.
Definition Texture.hpp:77
bool bound
Whether texture is bound to OpenGL.
Definition Texture.hpp:79
void operator=(const Texture ©)
Assignment operator.
Definition Texture.cpp:18
void BindTexture(bool force=false)
Bind texture to OpenGL Generates and configures texture in GPU memory.
Definition Texture.cpp:26
bool IsBound() const
Check if texture is bound to OpenGL.
Definition Texture.hpp:55
void FreeTexture()
Free texture from OpenGL Releases texture from GPU memory.
Definition Texture.cpp:50
static const Texture empty
Empty texture singleton.
Definition Texture.hpp:70
std::string path
Path to texture file.
Definition Texture.hpp:76
GLuint GLLocation
OpenGL texture ID.
Definition Texture.hpp:78
Texture()
Create empty texture.
Definition Texture.hpp:74
std::string GetPath() const
Get texture file path.
Definition Texture.hpp:67
~Texture()
Clean up texture resources.
Definition Texture.cpp:25
GLuint GetGLLocation() const
Get OpenGL texture ID.
Definition Texture.hpp:61
Texture(Resources::Resource file)
Load texture from resource.
Definition Texture.cpp:14