2#ifdef StevEngine_RENDERER_GL
3#include "main/ResourceManager.hpp"
9namespace StevEngine::Visuals {
92 ComputeTexture(
const ComputeTexture& copy);
108 bool AttachToFrameBuffer(uint32_t framebuffer, GLenum attachmentType = GL_COLOR_ATTACHMENT0);
117 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:121
const uint32_t height
Height of the texture.
Definition Texture.hpp:120
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:86
const uint32_t width
Width of the texture.
Definition Texture.hpp:119
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:73
void BindTexture(bool force=false)
Bind texture to OpenGL Generates and configures texture in GPU memory.
Definition Texture.cpp:59
SDL_Surface * surface
SDL surface containing image data.
Definition Texture.hpp:79
bool bound
Whether texture is bound to OpenGL.
Definition Texture.hpp:81
void operator=(const Texture ©)
Assignment operator.
Definition Texture.cpp:17
void BindTexture(bool force=false)
Bind texture to OpenGL Generates and configures texture in GPU memory.
Definition Texture.cpp:25
bool IsBound() const
Check if texture is bound to OpenGL.
Definition Texture.hpp:57
void FreeTexture()
Free texture from OpenGL Releases texture from GPU memory.
Definition Texture.cpp:49
static const Texture empty
Empty texture singleton.
Definition Texture.hpp:72
std::string path
Path to texture file.
Definition Texture.hpp:78
GLuint GLLocation
OpenGL texture ID.
Definition Texture.hpp:80
Texture()
Create empty texture.
Definition Texture.hpp:76
std::string GetPath() const
Get texture file path.
Definition Texture.hpp:69
~Texture()
Clean up texture resources.
Definition Texture.cpp:24
GLuint GetGLLocation() const
Get OpenGL texture ID.
Definition Texture.hpp:63
Texture(Resources::Resource file)
Load texture from resource.
Definition Texture.cpp:13