#include <src/ogreceguirenderer/OgreCEGUITexture.h>
Public Member Functions | |
virtual ushort | getHeight (void) const |
Returns the current pixel height of the texture. | |
Ogre::TexturePtr | getOgreTexture (void) const |
Return a pointer to the internal Ogre::Texture object. | |
virtual ushort | getWidth (void) const |
Returns the current pixel width of the texture. | |
virtual void | loadFromFile (const String &filename, const String &resourceGroup) |
Loads the specified image file into the texture. The texture is resized as required to hold the image. | |
virtual void | loadFromMemory (const void *buffPtr, uint buffWidth, uint buffHeight, PixelFormat pixelFormat) |
Loads (copies) an image in memory into the texture. The texture is resized as required to hold the image. | |
void | setOgreTexture (Ogre::TexturePtr &texture) |
Set the internal Ogre::TexturePtr object. | |
void | setOgreTextureSize (uint size) |
set the size of the internal Ogre texture. Previous Ogre texture is lost. | |
Private Member Functions | |
void | freeOgreTexture (void) |
Ogre::String | getUniqueName (void) |
OgreCEGUITexture (Renderer *owner) | |
virtual | ~OgreCEGUITexture (void) |
Private Attributes | |
ushort | d_height |
cached height of the texture | |
bool | d_isLinked |
True if we are linked to a texture we did not actually create. | |
Ogre::TexturePtr | d_ogre_texture |
The 'real' texture. | |
ushort | d_width |
cached width of the texture | |
Static Private Attributes | |
static uint32 | d_texturenumber = 0 |
Counter used to provide unique texture names. | |
Friends | |
Texture * | OgreCEGUIRenderer::createTexture (float size) |
Texture * | OgreCEGUIRenderer::createTexture (const String &filename, const String &resourceGroup) |
Texture * | OgreCEGUIRenderer::createTexture (void) |
void | OgreCEGUIRenderer::destroyTexture (Texture *texture) |
CEGUI::OgreCEGUITexture::OgreCEGUITexture | ( | Renderer * | owner | ) | [private] |
References d_isLinked, and d_ogre_texture.
CEGUI::OgreCEGUITexture::~OgreCEGUITexture | ( | void | ) | [private, virtual] |
References freeOgreTexture().
void CEGUI::OgreCEGUITexture::freeOgreTexture | ( | void | ) | [private] |
References d_isLinked, and d_ogre_texture.
Referenced by loadFromFile(), loadFromMemory(), setOgreTexture(), setOgreTextureSize(), and ~OgreCEGUITexture().
virtual ushort CEGUI::OgreCEGUITexture::getHeight | ( | void | ) | const [inline, virtual] |
Returns the current pixel height of the texture.
Ogre::TexturePtr CEGUI::OgreCEGUITexture::getOgreTexture | ( | void | ) | const [inline] |
Return a pointer to the internal Ogre::Texture object.
Ogre::String CEGUI::OgreCEGUITexture::getUniqueName | ( | void | ) | [private] |
References d_texturenumber, and orxonox::MT_Type::String.
Referenced by loadFromMemory(), and setOgreTextureSize().
virtual ushort CEGUI::OgreCEGUITexture::getWidth | ( | void | ) | const [inline, virtual] |
Returns the current pixel width of the texture.
void CEGUI::OgreCEGUITexture::loadFromFile | ( | const String & | filename, | |
const String & | resourceGroup | |||
) | [virtual] |
Loads the specified image file into the texture. The texture is resized as required to hold the image.
filename | The filename of the image file that is to be loaded into the texture |
References d_height, d_isLinked, d_ogre_texture, d_width, freeOgreTexture(), and orxonox::MT_Type::String.
Referenced by CEGUI::OgreCEGUIRenderer::createTexture().
void CEGUI::OgreCEGUITexture::loadFromMemory | ( | const void * | buffPtr, | |
uint | buffWidth, | |||
uint | buffHeight, | |||
PixelFormat | pixelFormat | |||
) | [virtual] |
Loads (copies) an image in memory into the texture. The texture is resized as required to hold the image.
buffPtr | Pointer to the buffer containing the image data | |
buffWidth | Width of the buffer (in pixels as specified by pixelFormat ) | |
buffHeight | Height of the buffer (in pixels as specified by pixelFormat ) | |
pixelFormat | PixelFormat value describing the format contained in buffPtr |
References byteSwap, d_height, d_ogre_texture, d_width, freeOgreTexture(), and getUniqueName().
void CEGUI::OgreCEGUITexture::setOgreTexture | ( | Ogre::TexturePtr & | texture | ) |
Set the internal Ogre::TexturePtr object.
texture | Reference to an Ogre::TexturePtr object that is to be used by this Texture object. |
References d_height, d_isLinked, d_ogre_texture, d_width, and freeOgreTexture().
Referenced by CEGUI::OgreCEGUIRenderer::createTexture().
void CEGUI::OgreCEGUITexture::setOgreTextureSize | ( | uint | size | ) |
set the size of the internal Ogre texture. Previous Ogre texture is lost.
size | pixel size of the new internal texture. This will be rounded up to a power of 2. |
References d_height, d_ogre_texture, d_width, freeOgreTexture(), and getUniqueName().
Referenced by CEGUI::OgreCEGUIRenderer::createTexture().
Texture* OgreCEGUIRenderer::createTexture | ( | float | size | ) | [friend] |
Texture* OgreCEGUIRenderer::createTexture | ( | const String & | filename, | |
const String & | resourceGroup | |||
) | [friend] |
Texture* OgreCEGUIRenderer::createTexture | ( | void | ) | [friend] |
void OgreCEGUIRenderer::destroyTexture | ( | Texture * | texture | ) | [friend] |
ushort CEGUI::OgreCEGUITexture::d_height [private] |
cached height of the texture
Referenced by loadFromFile(), loadFromMemory(), setOgreTexture(), and setOgreTextureSize().
bool CEGUI::OgreCEGUITexture::d_isLinked [private] |
True if we are linked to a texture we did not actually create.
Referenced by freeOgreTexture(), loadFromFile(), OgreCEGUITexture(), and setOgreTexture().
Ogre::TexturePtr CEGUI::OgreCEGUITexture::d_ogre_texture [private] |
The 'real' texture.
Referenced by freeOgreTexture(), loadFromFile(), loadFromMemory(), OgreCEGUITexture(), setOgreTexture(), and setOgreTextureSize().
uint32 CEGUI::OgreCEGUITexture::d_texturenumber = 0 [static, private] |
ushort CEGUI::OgreCEGUITexture::d_width [private] |
cached width of the texture
Referenced by loadFromFile(), loadFromMemory(), setOgreTexture(), and setOgreTextureSize().