#include <gelTexture.h>
Public Member Functions | |
GelTexture () | |
Default constructor. | |
GelTexture (const GelString &filename, ImageType type, TextureFilter filter=GEL_LINEAR, TextureWrap wrap=GEL_NO_REPEAT) | |
Convenience constructor. | |
GelTexture (GelImageData *image, TextureFilter filter=GEL_LINEAR, TextureWrap wrap=GEL_NO_REPEAT) | |
Convenience constructor. | |
~GelTexture () | |
Destructor. | |
void | load (const GelString &filename, ImageType type, TextureFilter filter=GEL_LINEAR, TextureWrap wrap=GEL_NO_REPEAT) |
Loads an image into the texture. | |
void | loadOverlay (const GelString &filename, ImageType type, int xoffset, int yoffset) |
Loads an image and overlays it onto the existing texture. | |
void | load (GelImageData *image, TextureFilter filter=GEL_LINEAR, TextureWrap wrap=GEL_NO_REPEAT) |
Loads raw image data into the texture. | |
void | setFilterMode (TextureFilter mode) |
Sets the texture filtering mode. | |
void | setWrapMode (TextureWrap mode) |
Sets the texture wrapping mode. | |
void | setTexFunc (TextureFunction mode) |
Sets the texture function mode. | |
int | getWidth () const |
Gets the width of the texture. | |
int | getHeight () const |
Gets the height of the texture. | |
int | getRealWidth () const |
Gets the real width of the texture. | |
int | getRealHeight () const |
Gets the real height of the texture. | |
ColorMode | getFormat () const |
Gets the texture's color format. | |
int | getBpp () const |
Gets the texture's number of bytes per pixel. | |
GELuint | getID () const |
Gets the texture's ID. |
gel::GelTexture::GelTexture | ( | ) |
Default constructor.
gel::GelTexture::GelTexture | ( | const GelString & | filename, |
ImageType | type, | ||
TextureFilter | filter = GEL_LINEAR , |
||
TextureWrap | wrap = GEL_NO_REPEAT |
||
) |
Convenience constructor.
Loads an image into the texture.
gel::GelTexture::GelTexture | ( | GelImageData * | image, |
TextureFilter | filter = GEL_LINEAR , |
||
TextureWrap | wrap = GEL_NO_REPEAT |
||
) |
Convenience constructor.
Loads an image into the texture.
gel::GelTexture::~GelTexture | ( | ) |
Destructor.
void gel::GelTexture::load | ( | const GelString & | filename, |
ImageType | type, | ||
TextureFilter | filter = GEL_LINEAR , |
||
TextureWrap | wrap = GEL_NO_REPEAT |
||
) |
Loads an image into the texture.
filename | : String holding the filename of the image to be read. |
type | : The image format. Can be either IMG_PNG or IMG_TGA. |
filter | : How to filter the image when sampling. Can be either GEL_NEAREST or GEL_LINEAR. If omitted, defaults to GEL_LINEAR. |
wrap | : How to wrap the image when uv coordinates exceed image boundaries. Options are GEL_REPEAT, GEL_NO_REPEAT, or GEL_CLAMP. If omitted, defaults to GEL_NO_REPEAT. |
void gel::GelTexture::loadOverlay | ( | const GelString & | filename, |
ImageType | type, | ||
int | xoffset, | ||
int | yoffset | ||
) |
Loads an image and overlays it onto the existing texture.
This function should only be called after an image has already been loaded into the texture.
filename | : The filename of the image to be read. |
type | : The image format. Can be either IMG_PNG or IMG_TGA. |
xoffset | : The overlay image's horizontal offset. |
yoffset | : The overlay image's vertical offset. |
void gel::GelTexture::load | ( | GelImageData * | image, |
TextureFilter | filter = GEL_LINEAR , |
||
TextureWrap | wrap = GEL_NO_REPEAT |
||
) |
Loads raw image data into the texture.
Use this function with care; it is easy to feed it wrong information and crash the program.
image | : Pointer to an image data structure containing the width, height, format, bytes per pixel, and a pointer to the image data to be written. |
filter | : How to filter the image when sampling. If omitted, defaults to GEL_LINEAR. |
wrap | : How to wrap the image when uv coordinates exceed image boundaries. If omitted, defaults to GEL_NO_REPEAT. |
void gel::GelTexture::setFilterMode | ( | TextureFilter | mode | ) |
Sets the texture filtering mode.
This determines how to filter the image when texels cannot be directly mapped to pixels, (i.e. the image has been scaled, rotated, or distorted).
mode | : Valid modes are GEL_NEAREST or GEL_LINEAR. |
void gel::GelTexture::setWrapMode | ( | TextureWrap | mode | ) |
Sets the texture wrapping mode.
This determines how the image will be wrapped when uv coordinates exceed image boundaries.
mode | : Valid modes are GEL_REPEAT, GEL_NO_REPEAT, or GEL_CLAMP. |
void gel::GelTexture::setTexFunc | ( | TextureFunction | mode | ) |
Sets the texture function mode.
This determines how the texture will be blended with the object's color.
mode | : Valid modes are GEL_DECAL, GEL_MODULATE, or GEL_REPLACE. |
int gel::GelTexture::getWidth | ( | ) | const [inline] |
Gets the width of the texture.
int gel::GelTexture::getHeight | ( | ) | const [inline] |
Gets the height of the texture.
int gel::GelTexture::getRealWidth | ( | ) | const [inline] |
Gets the real width of the texture.
int gel::GelTexture::getRealHeight | ( | ) | const [inline] |
Gets the real height of the texture.
ColorMode gel::GelTexture::getFormat | ( | ) | const [inline] |
Gets the texture's color format.
int gel::GelTexture::getBpp | ( | ) | const [inline] |
Gets the texture's number of bytes per pixel.
GELuint gel::GelTexture::getID | ( | ) | const [inline] |
Gets the texture's ID.
API Documentation by Mark D. Procarione | Generated by |