9 #include <SDL2/SDL_image.h> 126 void load(std::string path);
163 #endif // GLTEXTURE_HPP void load(std::string path)
Load the GLTexture from an image file on the path.
SDL_Surface * m_surf
An SDL surface useful for loading pixel data from a file.
Definition: GLTexture.hpp:149
Definition: GLTexture.hpp:31
int m_bitDepth
The bit depth of the texture.
Definition: GLTexture.hpp:153
Definition: GLTexture.hpp:49
Definition: GLTexture.hpp:47
GLTexture()
Default constructor - INACCESSIBLE!
Definition: GLTexture.hpp:64
Definition: GLTexture.hpp:28
Definition: GLTexture.hpp:48
void clear()
Clear all of the GLTexture data.
void disable()
Disables the GLTexture by unbinding the texture and calling glDisable(...).
Definition: GLTexture.hpp:30
GLint m_textureFilter_MAG
The texture parameter for the magnifying function.
Definition: GLTexture.hpp:158
GLint m_textureCoordinate_R
The wrap parameter for the R coordinate of the texture.
Definition: GLTexture.hpp:156
GLRect getTextureRect()
Get the GLTexture's texture rect with its bounds.
Definition: GLTexture.hpp:92
void setTextureCoordinateWrapParameters(GLint S, GLint T, GLint R)
Set the texture coordinate wrap parameters for the texture.
Definition: GLTexture.hpp:100
void setTextureFilterParameters(GLint min, GLint mag)
Set the texture filter parameters for the texture.
GLRect m_rect
The GLRect defining the bounds of the texture.
Definition: GLTexture.hpp:152
GLTextureFilter
Values for setting the texture filter functions for GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, and GL_TEXTURE_WRAP_R. These values have been aliased with member data (SEE MEMBER DATA FOR DETAILS). For further reference, refer to the OpenGL refpages: https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexParameter.xhtml.
Definition: GLTexture.hpp:43
GLuint m_textureID
The identifier for the texture.
Definition: GLTexture.hpp:151
Definition: GLTexture.hpp:46
Useful for defining size and origin of an OpenGL object.
Definition: GLTransformable.hpp:15
Definition: GLTexture.hpp:45
void use()
Use the GLTexture by activating and binding it to your OpenGL program.
int m_pixelFormat
Stores the pixel format of the image that is loaded.
Definition: GLTexture.hpp:150
GLint m_textureCoordinate_T
The wrap parameter for the T coordinate of the texture.
Definition: GLTexture.hpp:155
void setTextureRect(GLRect rect)
Set the GLTexture's texture rect.
Definition: GLTexture.hpp:100
Definition: GLTexture.hpp:29
GLint m_textureCoordinate_S
The wrap parameter for the S coordinate of the texture.
Definition: GLTexture.hpp:154
Class for creating textures usable with OpenGL from SDL.
Definition: GLTexture.hpp:57
GLTextureWrap
Definition: GLTexture.hpp:25
GLint m_textureFilter_MIN
The texture parameter for the minifying function.
Definition: GLTexture.hpp:157
Definition: GLTexture.hpp:27
void updateParameters()
Internally resets the texture parameters so that textures render as expected.
Definition: GLTexture.hpp:64