#include <ddgtexture.h>
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... | |||
ddgImage* | image (void) | ||
Return the image assigned to this texture. | |||
ddgVector4* | color (void) | ||
Return the base color of the texture. |
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);
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.