#include <Texture.h>
Inheritance diagram for Teddy::Graphics::Texture:
Public Methods | |
Texture (const std::string &name) | |
Texture constructor. More... | |
virtual | ~Texture () |
Texture destructor. More... | |
void | putData (unsigned char *data, const Teddy::Maths::IntVector2 &size, int format, unsigned long modify) |
void | apply () |
Apply texture to OpenGL state. More... | |
bool | isGood () |
Return true if there is actual texturemap bind to this texture. More... | |
const Teddy::Maths::IntVector2 & | getSize () |
Return the size of this Texture in texels. More... | |
void | setWrap (int wrap_s, int wrap_t) |
Set texture repeat parameters. More... | |
void | setEnv (int env) |
Set Texture function. More... | |
void | setEnv (int env, const Color &c) |
Set Texture function. More... | |
void | setFilter (int filter) |
Set Texture filter. More... | |
bool | doFormat () |
Determine the final image data format for Texture. More... | |
bool | doSize () |
Determine the final size for Texture image data. More... | |
bool | doBind () |
Bind the image data to texture. More... | |
void | setWorkData (void *data, bool alloc=true) |
Set working data for Texture. More... | |
void | convert_to_a () |
Convert Texture working image data to alpha-only format. More... | |
void | convert_to_rgb () |
Convert Texture working image data to red-green-blue format. More... | |
void | convert_rgba () |
void | convert_rgb_to_a () |
Convert Texture working image data from red-green-blue format to alpha format; alpha == red. More... | |
void | convert_rgba_to_a () |
Convert Texture working image data from red-green-blue-alpha to alpha format. More... | |
void | convert_a_to_rgb () |
Convert Texture working image data from alpha format to red-green-blue format (greyscale). More... | |
void | convert_rgba_to_rgb () |
Convert Texture working image data from red-green-blue-alpha to red-green-blue format. More... | |
void | convert_rgb_to_rgba () |
Static Public Attributes | |
const unsigned long | TX_RESERVED = (1ul<<0ul) |
const unsigned long | TX_BLIT_NO_SCALE = (1ul<<1ul) |
const unsigned long | TX_GENERATE_ALPHA = (1ul<<2ul) |
const unsigned long | TX_ALPHA_ONLY = (1ul<<3ul) |
const unsigned long | TX_NO_ALPHA = (1ul<<4ul) |
const unsigned long | WRAP_REPEAT = 1 |
const unsigned long | WRAP_CLAMP = 2 |
const unsigned long | ENV_BLEND = 1 |
const unsigned long | ENV_REPLACE = 2 |
const unsigned long | ENV_DECAL = 3 |
const unsigned long | ENV_MODULATE = 4 |
const unsigned long | FORMAT_INTENSITY = 1 |
const unsigned long | FORMAT_LUMINANCE = 2 |
const unsigned long | FORMAT_LUMINANCE_ALPHA = 3 |
const unsigned long | FORMAT_ALPHA = 4 |
const unsigned long | FORMAT_RGB = 5 |
const unsigned long | FORMAT_RGBA = 6 |
const unsigned long | FILTER_NEAREST = 1 |
const unsigned long | FILTER_LINEAR = 2 |
Protected Attributes | |
unsigned char * | work_data |
Current working image data for Texture. More... | |
int | work_data_pixel_format |
Working image format. More... | |
bool | work_data_allocated |
Flag true if work_data was internally allocated. More... | |
bool | is_good |
If true, the texture is ready to be used. More... | |
Teddy::Maths::IntVector2 | size |
int | wrap_s |
Texture s-axis wrap mode. More... | |
int | wrap_t |
Texture t-axis wrap mode. More... | |
int | filter_mode |
Texture filter mode. More... | |
int | env_function |
Texture function. More... | |
Color | env_color |
Color for Texture function. More... | |
Teddy::MixIn::Options | modify |
Allowed and requested image modifications. More... | |
int | gl_internal_format |
OpenGL image data format. More... | |
GLuint | gl_texture_id |
OpenGL Texture id. More... |
Definition at line 41 of file Texture.h.
|
Texture constructor.
Definition at line 81 of file Texture.cpp. References env_color, ENV_DECAL, env_function, ENV_MODULATE, filter_mode, FILTER_NEAREST, gl_internal_format, gl_texture_id, is_good, modify, Teddy::MixIn::Options::options, work_data, work_data_allocated, work_data_pixel_format, WRAP_REPEAT, wrap_s, and wrap_t. |
|
Texture destructor.
Definition at line 107 of file Texture.cpp. References gl_texture_id, and setWorkData. |
|
Apply texture to OpenGL state.
Definition at line 114 of file Texture.cpp. References Teddy::SysSupport::emsg, gl_texture_id, and Teddy::SysSupport::M_MAT. |
|
Convert Texture working image data from alpha format to red-green-blue format (greyscale).
Definition at line 70 of file TextureConversions.cpp. References setWorkData, size, and work_data. Referenced by convert_to_rgb. |
|
Convert Texture working image data from red-green-blue format to alpha format; alpha == red.
Definition at line 91 of file TextureConversions.cpp. References setWorkData, size, and work_data. Referenced by convert_to_a. |
|
|
|
|
|
Convert Texture working image data from red-green-blue-alpha to alpha format.
Definition at line 116 of file TextureConversions.cpp. References setWorkData, size, and work_data. Referenced by convert_to_a. |
|
Convert Texture working image data from red-green-blue-alpha to red-green-blue format.
Definition at line 141 of file TextureConversions.cpp. References setWorkData, size, and work_data. Referenced by convert_to_rgb. |
|
Convert Texture working image data to alpha-only format.
Definition at line 35 of file TextureConversions.cpp. References convert_rgb_to_a, convert_rgba_to_a, and work_data_pixel_format. Referenced by doFormat. |
|
Convert Texture working image data to red-green-blue format.
Definition at line 47 of file TextureConversions.cpp. References convert_a_to_rgb, convert_rgba_to_rgb, and work_data_pixel_format. Referenced by doFormat. |
|
Bind the image data to texture.
Definition at line 383 of file Texture.cpp. References Teddy::SysSupport::emsg, ENV_BLEND, env_color, ENV_DECAL, ENV_MODULATE, ENV_REPLACE, FILTER_LINEAR, FILTER_NEAREST, gl_internal_format, gl_texture_id, glu_Build2DMipmaps, is_good, Teddy::MixIn::Options::isEnabled, Teddy::SysSupport::M_MAT, modify, size, TX_BLIT_NO_SCALE, work_data, work_data_pixel_format, WRAP_CLAMP, and WRAP_REPEAT. |
|
Determine the final image data format for Texture.
Definition at line 241 of file Texture.cpp. References convert_to_a, convert_to_rgb, Teddy::SysSupport::emsg, gl_internal_format, Teddy::MixIn::Options::isEnabled, Teddy::SysSupport::M_MAT, modify, TX_ALPHA_ONLY, TX_GENERATE_ALPHA, TX_NO_ALPHA, and work_data_pixel_format. |
|
Determine the final size for Texture image data.
Definition at line 276 of file Texture.cpp. References Teddy::SysSupport::emsg, gl_internal_format, glu_ScaleImage, IntVector2, Teddy::SysSupport::M_MAT, Teddy::Graphics::minPow, setWorkData, size, work_data, and work_data_pixel_format. |
|
Return the size of this Texture in texels.
Definition at line 179 of file Texture.cpp. References IntVector2, and size. |
|
Return true if there is actual texturemap bind to this texture.
Definition at line 128 of file Texture.cpp. References is_good. |
|
Referenced by Teddy::Graphics::ImageFileTexture::copySdlSurface. |
|
Set Texture function.
Definition at line 158 of file Texture.cpp. References env_color, and env_function. |
|
Set Texture function.
Definition at line 148 of file Texture.cpp. References env_function. Referenced by Teddy::Graphics::ImageFileTexture::copySdlSurface. |
|
Set Texture filter.
Definition at line 170 of file Texture.cpp. References filter_mode. Referenced by Teddy::Graphics::ImageFileTexture::copySdlSurface. |
|
Set working data for Texture.
Definition at line 224 of file Texture.cpp. References work_data, and work_data_allocated. Referenced by convert_a_to_rgb, convert_rgb_to_a, convert_rgba_to_a, convert_rgba_to_rgb, doSize, and ~Texture. |
|
Set texture repeat parameters.
Definition at line 138 of file Texture.cpp. References wrap_s, and wrap_t. Referenced by Teddy::Graphics::ImageFileTexture::copySdlSurface. |
|
Definition at line 48 of file Texture.cpp. Referenced by doBind. |
|
|
|
Definition at line 50 of file Texture.cpp. |
|
Texture function.
|
|
Definition at line 51 of file Texture.cpp. Referenced by Teddy::Graphics::ImageFileTexture::copySdlSurface, doBind, and Texture. |
|
Definition at line 49 of file Texture.cpp. Referenced by doBind. |
|
Definition at line 61 of file Texture.cpp. Referenced by Teddy::Graphics::ImageFileTexture::copySdlSurface, and doBind. |
|
Texture filter mode.
|
|
Definition at line 60 of file Texture.cpp. |
|
Definition at line 56 of file Texture.cpp. |
|
Definition at line 53 of file Texture.cpp. |
|
Definition at line 54 of file Texture.cpp. |
|
Definition at line 55 of file Texture.cpp. |
|
Definition at line 57 of file Texture.cpp. Referenced by Teddy::Graphics::ImageFileTexture::copySdlSurface. |
|
Definition at line 58 of file Texture.cpp. Referenced by Teddy::Graphics::ImageFileTexture::copySdlSurface. |
|
OpenGL image data format.
|
|
OpenGL Texture id.
Definition at line 111 of file Texture.h. Referenced by apply, doBind, Teddy::Graphics::PixFileTexture::PixFileTexture, Texture, and ~Texture. |
|
If true, the texture is ready to be used.
Definition at line 102 of file Texture.h. Referenced by doBind, Teddy::Graphics::ImageFileTexture::ImageFileTexture, isGood, Teddy::Graphics::PixFileTexture::PixFileTexture, and Texture. |
|
Allowed and requested image modifications.
|
|
Definition at line 103 of file Texture.h. Referenced by convert_a_to_rgb, convert_rgb_to_a, convert_rgba_to_a, convert_rgba_to_rgb, Teddy::Graphics::ImageFileTexture::copySdlSurface, doBind, doSize, getSize, and Teddy::Graphics::PixFileTexture::PixFileTexture. |
|
Definition at line 42 of file Texture.cpp. Referenced by doFormat. |
|
Definition at line 40 of file Texture.cpp. Referenced by doBind. |
|
Definition at line 41 of file Texture.cpp. Referenced by doFormat. |
|
Definition at line 43 of file Texture.cpp. Referenced by doFormat. |
|
Definition at line 39 of file Texture.cpp. |
|
Current working image data for Texture.
Definition at line 99 of file Texture.h. Referenced by convert_a_to_rgb, convert_rgb_to_a, convert_rgba_to_a, convert_rgba_to_rgb, doBind, doSize, setWorkData, and Texture. |
|
Flag true if work_data was internally allocated.
Definition at line 101 of file Texture.h. Referenced by setWorkData, and Texture. |
|
Working image format.
Definition at line 100 of file Texture.h. Referenced by convert_to_a, convert_to_rgb, doBind, doFormat, doSize, and Texture. |
|
Definition at line 46 of file Texture.cpp. Referenced by doBind. |
|
Definition at line 45 of file Texture.cpp. Referenced by Teddy::Graphics::ImageFileTexture::copySdlSurface, doBind, and Texture. |
|
Texture s-axis wrap mode.
|
|
Texture t-axis wrap mode.
|