CLtexture Struct Reference

Defines a 2D texture. More...

#include <cl.h>


Data Fields

CLimage image
GLenum min_filter
GLenum mag_filter
GLenum wrap_s
GLenum wrap_t
GLuint texture_object


Detailed Description

The CLtexture struct defines a texture. Its members can be passed to the OpenGL functions glTexParameter() and glTexImage2D():

Example

  CLtexture texture;

  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, texture.min_filter);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, texture.mag_filter);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, texture.wrap_s);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, texture.wrap_t);

  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 
               texture.image.width, texture.image.height, 0, 
               texture.image.format, texture.image.type, 
               texture.image.data);
  

The texture_object member is an OpenGL texture object ID. It is set bt the clUpdateTexture() function and used by the clLoadTexture() function. However, it may also be set and used by the user.

For more information on CLtexture members consult the OpenGL documentation for glTexImage2D() and glTexParameter().

Definition at line 521 of file cl.h.


Generated on Thu Dec 27 13:53:42 2007 for CL by  doxygen 1.4.6