Class GlTexture

Class Documentation

class GlTexture

Public Functions

GlTexture(unsigned char *pixels, int width, int height)

Initializes a texture with given date. Class will release the data.

Parameters:
  • pixels – The image data of the texture. Pixel aligned, three bytes per pixel

  • width – The image width

  • height – The image height

GlTexture(const GlTexture &other)

Copy ctor.

GlTexture(const Texture &other)

Copy ctor.

inline GlTexture()

Empty ctor.

virtual ~GlTexture()

Dtor.

inline void bind() const

Bind the texture to the current OpenGL context.

void upload()

Does all the OpenGL stuff to make it avialable for rendering.

Public Members

int m_width

The width of the texture in pixels.

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)

GLuint m_texIndex

The texture index of the texture.