Main Page   Class Hierarchy   Compound List   Header Files   Compound Members  

ddgTexture Class Reference

A convenience function to support textures. More...

#include <ddgtexture.h>

List of all members.


Public Members

enum  Mode { DECAL, MODULATE, BLEND }
Mode with which to apply the texture to the frame buffer.

 ddgTexture ( ddgImage *i = 0, bool l = false, bool r = true, Mode m = DECAL)
bool init (void)
Initialize the texture. Must be called before rendering.

void linear ( bool l )
Set linear filtering.

void repeat ( bool r )
Set linear filtering.

bool activate (void)
Activate this texture. Called before sending geometry.

bool deactivate (void)
Deactivate this texture. Called after sending geometry.

void scale ( float w, float h)
Set the size this texture represents. More...

void mode ( Mode m, ddgColor4 *c = NULL)
Set the texture mode and the color to use for BLEND or MODULATE. More...

ddgImageimage (void)
Return the image assigned to this texture.

ddgVector4* color (void)
Return the base color of the texture.


Detailed Description

A convenience function to support textures.

ddgTextures require an ddgImage to hold the texture data. By default textures are initialized so that texture coordinates can be specified from 0.0 to 1.0. If you prefer to specify texture coordinates in pixels, call scale with (1,1). If you want to specify some arbitrary coordinate system from 0-n, 0-m scale with (image->cols/n,image->rows/m);


Member Function Documentation

void ddgTexture::scale (float w, float h) [inline]

Set the size this texture represents.

independent of the actual image size. By default a texture is scaled to have a texture coordinate range from 0 to 1.

void ddgTexture::mode (Mode m, ddgColor4 * c = NULL) [inline]

Set the texture mode and the color to use for BLEND or MODULATE.

Note for MODULATE this is only a default color. You can emit any colour during rendering.


The documentation for this class was generated from the following file:
Generated at Sun Sep 17 19:27:57 2000 for Digital Dawn Graphics Toolkit by doxygen 0.49-991205 written by Dimitri van Heesch, © 1997-1999