43 GlTexture::GlTexture(
unsigned char* pixels,
int width,
int height)
44 : m_width(width), m_height(height), m_pixels(pixels)
111 glEnable(GL_TEXTURE_2D);
113 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
133 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
134 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
135 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
136 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
137 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
unsigned char m_numBytesPerChan
The number of bytes per channel.
int m_width
The width of the texture in pixels.
This class represents a texture.
void upload()
Does all the OpenGL stuff to make it avialable for rendering.
int m_height
The height of the texture in pixels.
unsigned char * m_pixels
The aligned pixel data. Three bytes per pixel (r,g,b)
virtual ~GlTexture()
Dtor.
unsigned char * m_data
The texture data.
unsigned short int m_width
The dimensions of the texture.
unsigned char m_numChannels
The number of color channels.
GLuint m_texIndex
The texture index of the texture.
unsigned short int m_height