GLPCTexture.h

Classes

GLPCTextureParams -- Holds parameters for setting glTexParameteri variables. (full description)
GLPCTexturedImage -- (full description)

class GLPCTextureParams

Interface

Public Members
GLPCTextureParams()
GLPCTextureParams(const GLPCTextureParams &)
GLPCTextureParams(const GLPCTextureParams *)
void copy(const GLPCTextureParams &p)
~GLPCTextureParams()
void filter(GLint minFilter, GLint magFilter=0)
void wrap(GLint wrapS, GLint wrapT=0)
void maxTextureSize(GLint maxtexturesize)
void format(GLenum fmt)
void environMode(GLenum mode)
Private Members
void init()

Description

Synopsis

Holds parameters for setting glTexParameteri variables. See the man page for glTexParameteri for description. This class is not needed unless the caller wishes to change the defaults for a textured image. maxtexturesize is used to specify the maximum texture size used for an image. The value used will be the smallest power of 2 that is >= maxtexturesize. By default, the display hosts' maximum texture size will be used. Again, this isn't normally changed. GLPCTextureParams may be deleted after GLPCTexturedImage is created.

Member Description

GLPCTextureParams()

GLPCTextureParams(const GLPCTextureParams &)

GLPCTextureParams(const GLPCTextureParams *)

void copy(const GLPCTextureParams &p)

~GLPCTextureParams()

void filter(GLint minFilter, GLint magFilter=0)

Set min/mag filters. If magFilter is 0, use min Filter.

void wrap(GLint wrapS, GLint wrapT=0)

Set wrap parameters. If wrapT is 0, use wrapS.

void maxTextureSize(GLint maxtexturesize)

Set value to use for max texture size. Value will be rounded up to a power of 2 >= maxTextureSize.

void format(GLenum fmt)

void environMode(GLenum mode)

For glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, mode);

void init()

GL_RGB or GL_COLOR_INDEX.

class GLPCTexturedImage : public GLPCDisplayListEntry

Interface

Public Members
GLPCTexturedImage(GLsizei width, GLsizei height, const GLushort *pixels, const GLu* = NULL)
~GLPCTexturedImage()
void draw()
void draw(GLfloat x, GLfloat y, GLfloat z=0.0, GLfloat xscale=1.0, GLfloat yscale=1.0)
void envmode(GLenum mode)
GLenum envmode()const
GLPCTextureParams *params()const
Private Members
void createTextures(GLsizei dWidth, GLsizei dHeight)
void storeImage(GLsizei dWidth, GLsizei dHeight, const GLushort *pixels)

Description

Prerequisite

Synopsis

GLPCTexturedImage is used to convert an image to texture objects for display. The pixels array contains pixels stored as RGB triples. This class is typically only used by GLPixelCanvas If the image is larger than the maximum texture size, it will be broken into pieces that fit.

Thrown Exceptions

Member Description

GLPCTexturedImage(GLsizei width, GLsizei height, const GLushort *pixels, const GLu* = NULL)

~GLPCTexturedImage()

void draw()

void draw(GLfloat x, GLfloat y, GLfloat z=0.0, GLfloat xscale=1.0, GLfloat yscale=1.0)

Draw image using current values. Draw image and save values for later.

void envmode(GLenum mode)

GLenum envmode()const

GLPCTextureParams *params()const

void createTextures(GLsizei dWidth, GLsizei dHeight)

void storeImage(GLsizei dWidth, GLsizei dHeight, const GLushort *pixels)