![]() |
PROTO::KLUDGE
0.1
Quick prototyping library for games using SDL and OpenGL.
|
Class for creating textures usable with OpenGL from SDL. More...
#include <GLTexture.hpp>
Public Member Functions | |
virtual | ~GLTexture () |
GLTexture (std::string path) | |
GLRect | getTextureRect () |
Get the GLTexture's texture rect with its bounds. More... | |
void | setTextureRect (GLRect rect) |
Set the GLTexture's texture rect. More... | |
void | setTextureCoordinateWrapParameters (GLint S, GLint T, GLint R) |
Set the texture coordinate wrap parameters for the texture. More... | |
void | setTextureFilterParameters (GLint min, GLint mag) |
Set the texture filter parameters for the texture. More... | |
void | load (std::string path) |
Load the GLTexture from an image file on the path. More... | |
void | use () |
Use the GLTexture by activating and binding it to your OpenGL program. More... | |
void | disable () |
Disables the GLTexture by unbinding the texture and calling glDisable(...). More... | |
void | clear () |
Clear all of the GLTexture data. More... | |
Private Member Functions | |
GLTexture () | |
Default constructor - INACCESSIBLE! More... | |
void | updateParameters () |
Internally resets the texture parameters so that textures render as expected. More... | |
Private Attributes | |
SDL_Surface * | m_surf |
An SDL surface useful for loading pixel data from a file. More... | |
int | m_pixelFormat |
Stores the pixel format of the image that is loaded. More... | |
GLuint | m_textureID |
The identifier for the texture. More... | |
GLRect | m_rect |
The GLRect defining the bounds of the texture. More... | |
int | m_bitDepth |
The bit depth of the texture. More... | |
GLint | m_textureCoordinate_S |
The wrap parameter for the S coordinate of the texture. More... | |
GLint | m_textureCoordinate_T |
The wrap parameter for the T coordinate of the texture. More... | |
GLint | m_textureCoordinate_R |
The wrap parameter for the R coordinate of the texture. More... | |
GLint | m_textureFilter_MIN |
The texture parameter for the minifying function. More... | |
GLint | m_textureFilter_MAG |
The texture parameter for the magnifying function. More... | |
Class for creating textures usable with OpenGL from SDL.
|
inlineprivate |
Default constructor - INACCESSIBLE!
|
virtual |
pk::GLTexture::GLTexture | ( | std::string | path | ) |
pk::GLTexture::clear | ( | ) |
Clear all of the GLTexture data.
pk::GLTexture::disable | ( | ) |
Disables the GLTexture by unbinding the texture and calling glDisable(...).
|
inline |
pk::GLTexture::load | ( | std::string | path | ) |
Load the GLTexture from an image file on the path.
void pk::GLTexture::setTextureCoordinateWrapParameters | ( | GLint | S, |
GLint | T, | ||
GLint | R | ||
) |
Set the texture coordinate wrap parameters for the texture.
GLint | S - the OpenGL wrap parameter for S texture coordinates. |
GLint | T - the OpenGL wrap parameter for T texture coordinates. |
GLint | R - the OpenGL wrap parameter for R texture coordinates. |
void pk::GLTexture::setTextureFilterParameters | ( | GLint | min, |
GLint | mag | ||
) |
Set the texture filter parameters for the texture.
GLint | min - the OpenGL minifying function parameter for the texture. |
GLint | mag - the OpenGL magnifying function parameter for the texture. |
|
inline |
|
private |
Internally resets the texture parameters so that textures render as expected.
pk::GLTexture::use | ( | ) |
Use the GLTexture by activating and binding it to your OpenGL program.
|
private |
The bit depth of the texture.
|
private |
Stores the pixel format of the image that is loaded.
|
private |
An SDL surface useful for loading pixel data from a file.
|
private |
The wrap parameter for the R coordinate of the texture.
|
private |
The wrap parameter for the S coordinate of the texture.
|
private |
The wrap parameter for the T coordinate of the texture.
|
private |
The texture parameter for the magnifying function.
|
private |
The texture parameter for the minifying function.
|
private |
The identifier for the texture.