#include <OGLParts.h>
Public Member Functions | |
Texture () | |
~Texture () | |
bool | MakeDynamicTexture (int iWidth, int iHeight, TextureType tt) |
bool | LoadTextureFile (const char *sFileName) |
Load the image from the drive in the format of a .ppm file. | |
bool | LoadTexture (char *sRawData, int iWidth, int iHeight, TextureType tt) |
Load the image from raw data on the CPU. | |
bool | ActivateTexture (int iPlace=0) |
Activate the texture in the iPlaceth slot. | |
bool | DeactivateTexture (int iPlace=0) |
Deactivate the texture in the iPlaceth slot. | |
unsigned int | GetTexHandle () |
Obtain the OpenGL Texture handle. | |
bool | StripFromScreen (int x, int y, int width, int height) |
Strip the texture from the screen into the texture. Note, you must have. | |
int | GetWidth () |
Get width of the texture. | |
int | GetHeight () |
Get height of the texture. | |
void | ChangeFilter (bool bNearest) |
Private Attributes | |
GLuint | iTexture |
TextureType | mtt |
int | mWidth |
int | mHeight |
This can be used for loading .ppm files or just data straight from the drive. the idea is that you turn on textures like states. Once a texture is loaded you can turn it on to affect anything that gets drawn. Most systems have 4-8 texture slots that can be activated and used as input for your shaders.
Textures can have data inputted into them from either a file, CPU memory, stripped off of the screen or written by a render/frame buffer.
Definition at line 141 of file OGLParts.h.
Texture::Texture | ( | ) | [inline] |
Definition at line 144 of file OGLParts.h.
Texture::~Texture | ( | ) |
Definition at line 417 of file OGLParts.cpp.
bool Texture::MakeDynamicTexture | ( | int | iWidth, | |
int | iHeight, | |||
TextureType | tt | |||
) |
Setup the texture to behave as a dynamic texture. This is to be used when you write to it using the screen or a render/frame buffer.
Definition at line 437 of file OGLParts.cpp.
bool Texture::LoadTextureFile | ( | const char * | sFileName | ) |
Load the image from the drive in the format of a .ppm file.
Definition at line 456 of file OGLParts.cpp.
bool Texture::LoadTexture | ( | char * | sRawData, | |
int | iWidth, | |||
int | iHeight, | |||
TextureType | tt | |||
) |
bool Texture::ActivateTexture | ( | int | iPlace = 0 |
) |
bool Texture::DeactivateTexture | ( | int | iPlace = 0 |
) |
unsigned int Texture::GetTexHandle | ( | ) | [inline] |
bool Texture::StripFromScreen | ( | int | x, | |
int | y, | |||
int | width, | |||
int | height | |||
) |
Strip the texture from the screen into the texture. Note, you must have.
Definition at line 424 of file OGLParts.cpp.
int Texture::GetWidth | ( | ) | [inline] |
int Texture::GetHeight | ( | ) | [inline] |
void Texture::ChangeFilter | ( | bool | bNearest | ) |
Switch between glNearest (1) or glNicest (0). You want to use Nearest for any data processing, and Nicest for anything that will be presented.
Definition at line 501 of file OGLParts.cpp.
GLuint Texture::iTexture [private] |
Definition at line 180 of file OGLParts.h.
TextureType Texture::mtt [private] |
Definition at line 181 of file OGLParts.h.
int Texture::mWidth [private] |
Definition at line 182 of file OGLParts.h.
int Texture::mHeight [private] |
Definition at line 182 of file OGLParts.h.