A base class for all OpenGL objects with loadable textures. More...
#include <mrpt/opengl/CTexturedObject.h>


Public Member Functions | |
| void | assignImage (const mrpt::utils::CImage &img, const mrpt::utils::CImage &imgAlpha) |
| Assigns a texture and a transparency image, and enables transparency (If the images are not 2^N x 2^M, they will be internally filled to its dimensions to be powers of two). | |
| void | assignImage (const mrpt::utils::CImage &img) |
| Assigns a texture image, and disable transparency. | |
| void | assignImage_fast (mrpt::utils::CImage &img, mrpt::utils::CImage &imgAlpha) |
| Similar to assignImage, but the passed images will be returned as empty: it avoids making a copy of the whole image, just copies a pointer. | |
| void | assignImage_fast (mrpt::utils::CImage &img) |
| Similar to assignImage, but the passed images will be returned as empty: it avoids making a copy of the whole image, just copies a pointer. | |
| void | loadTextureInOpenGL () const |
| VERY IMPORTANT: If you use a multi-thread application, you MUST call this from the same thread that will later destruct the object in order to the OpenGL texture memory to be correctly deleted. | |
Protected Member Functions | |
| CTexturedObject () | |
| virtual | ~CTexturedObject () |
| void | unloadTexture () |
| void | render_texture_pre () const |
| void | render_texture_post () const |
| void | writeToStreamTexturedObject (mrpt::utils::CStream &out) const |
| void | readFromStreamTexturedObject (mrpt::utils::CStream &in) |
Protected Attributes | |
| unsigned int | m_glTextureName |
| bool | m_texture_is_loaded |
| mrpt::utils::CImage | m_textureImage |
| mrpt::utils::CImage | m_textureImageAlpha |
| bool | m_enableTransparency |
| Of the texture using "m_textureImageAlpha". | |
| int | r_width |
| int | r_height |
| Size of the texture image, rounded up to next power of 2. | |
| int | m_fill_x_left |
| int | m_fill_y_top |
| int | m_fill_x_right |
| int | m_fill_y_bottom |
| The size of the fill in pixels in the textured image, w.r.t the image passed by the user. | |
A base class for all OpenGL objects with loadable textures.
Definition at line 47 of file CTexturedObject.h.
| mrpt::opengl::CTexturedObject::CTexturedObject | ( | ) | [protected] |
| virtual mrpt::opengl::CTexturedObject::~CTexturedObject | ( | ) | [protected, virtual] |
| void mrpt::opengl::CTexturedObject::assignImage | ( | const mrpt::utils::CImage & | img | ) |
Assigns a texture image, and disable transparency.
| void mrpt::opengl::CTexturedObject::assignImage | ( | const mrpt::utils::CImage & | img, | |
| const mrpt::utils::CImage & | imgAlpha | |||
| ) |
Assigns a texture and a transparency image, and enables transparency (If the images are not 2^N x 2^M, they will be internally filled to its dimensions to be powers of two).
| void mrpt::opengl::CTexturedObject::assignImage_fast | ( | mrpt::utils::CImage & | img | ) |
Similar to assignImage, but the passed images will be returned as empty: it avoids making a copy of the whole image, just copies a pointer.
| void mrpt::opengl::CTexturedObject::assignImage_fast | ( | mrpt::utils::CImage & | img, | |
| mrpt::utils::CImage & | imgAlpha | |||
| ) |
Similar to assignImage, but the passed images will be returned as empty: it avoids making a copy of the whole image, just copies a pointer.
| void mrpt::opengl::CTexturedObject::loadTextureInOpenGL | ( | ) | const |
VERY IMPORTANT: If you use a multi-thread application, you MUST call this from the same thread that will later destruct the object in order to the OpenGL texture memory to be correctly deleted.
Calling this method more than once has no effects. If you use one thread, this method will be automatically called when rendering, so there is no need to explicitly call it.
| void mrpt::opengl::CTexturedObject::readFromStreamTexturedObject | ( | mrpt::utils::CStream & | in | ) | [protected] |
| void mrpt::opengl::CTexturedObject::render_texture_post | ( | ) | const [protected] |
| void mrpt::opengl::CTexturedObject::render_texture_pre | ( | ) | const [protected] |
| void mrpt::opengl::CTexturedObject::unloadTexture | ( | ) | [protected] |
Reimplemented in mrpt::opengl::CTexturedPlane.
| void mrpt::opengl::CTexturedObject::writeToStreamTexturedObject | ( | mrpt::utils::CStream & | out | ) | const [protected] |
bool mrpt::opengl::CTexturedObject::m_enableTransparency [mutable, protected] |
Of the texture using "m_textureImageAlpha".
Definition at line 56 of file CTexturedObject.h.
int mrpt::opengl::CTexturedObject::m_fill_x_left [mutable, protected] |
Definition at line 58 of file CTexturedObject.h.
int mrpt::opengl::CTexturedObject::m_fill_x_right [mutable, protected] |
Definition at line 58 of file CTexturedObject.h.
int mrpt::opengl::CTexturedObject::m_fill_y_bottom [mutable, protected] |
The size of the fill in pixels in the textured image, w.r.t the image passed by the user.
Definition at line 58 of file CTexturedObject.h.
int mrpt::opengl::CTexturedObject::m_fill_y_top [mutable, protected] |
Definition at line 58 of file CTexturedObject.h.
unsigned int mrpt::opengl::CTexturedObject::m_glTextureName [mutable, protected] |
Definition at line 52 of file CTexturedObject.h.
bool mrpt::opengl::CTexturedObject::m_texture_is_loaded [mutable, protected] |
Definition at line 53 of file CTexturedObject.h.
mrpt::utils::CImage mrpt::opengl::CTexturedObject::m_textureImage [mutable, protected] |
Definition at line 54 of file CTexturedObject.h.
mrpt::utils::CImage mrpt::opengl::CTexturedObject::m_textureImageAlpha [mutable, protected] |
Definition at line 55 of file CTexturedObject.h.
int mrpt::opengl::CTexturedObject::r_height [mutable, protected] |
Size of the texture image, rounded up to next power of 2.
Definition at line 57 of file CTexturedObject.h.
int mrpt::opengl::CTexturedObject::r_width [mutable, protected] |
Definition at line 57 of file CTexturedObject.h.
| Page generated by Doxygen 1.6.1 for MRPT 0.9.0 SVN: at Mon Jun 7 06:47:58 UTC 2010 |