Orxonox: CEGUI::OgreCEGUITexture Class Reference

# CEGUI::OgreCEGUITexture Class Reference

Texture class that is created by OgreCEGUIRenderer objects. More...

`#include <src/ogreceguirenderer/OgreCEGUITexture.h>`

List of all members.

## 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)

## Detailed Description

Texture class that is created by OgreCEGUIRenderer objects.

## Constructor & Destructor Documentation

CEGUI::OgreCEGUITexture::OgreCEGUITexture | ( | Renderer * | owner | ) | `[private]`

References d_isLinked, and d_ogre_texture.

CEGUI::OgreCEGUITexture::~OgreCEGUITexture | ( | void |  | ) | `[private, virtual]`

References freeOgreTexture().

## Member Function Documentation

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.

Returns:
  ushort value that is the current height of the texture in pixels

Ogre::TexturePtr CEGUI::OgreCEGUITexture::getOgreTexture | ( | void |  | ) | const`[inline]`

Return a pointer to the internal Ogre::Texture object.

Returns:
  Pointer to the Ogre::Texture object currently being used by this 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.

Returns:
  ushort value that is the current width of the texture in pixels

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.

Parameters:

  | filename | The filename of the image file that is to be loaded into the texture

Returns:
  Nothing.

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.

Parameters:

  | 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

Returns:
  Nothing.

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.

Parameters:

  | texture | Reference to an Ogre::TexturePtr object that is to be used by this Texture object.

Returns:
  Nothing.

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.

Parameters:

  | size | pixel size of the new internal texture. This will be rounded up to a power of 2.

Returns:
  Nothing.

References d_height, d_ogre_texture, d_width, freeOgreTexture(), and getUniqueName().

Referenced by CEGUI::OgreCEGUIRenderer::createTexture().

## Friends And Related Function Documentation

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]`

## Member Data Documentation

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]`

Counter used to provide unique texture names.

Referenced by getUniqueName().

ushort CEGUI::OgreCEGUITexture::d_width`[private]`

cached width of the texture

Referenced by loadFromFile(), loadFromMemory(), setOgreTexture(), and setOgreTextureSize().

The documentation for this class was generated from the following files:

- src/ogreceguirenderer/OgreCEGUITexture.h
- src/ogreceguirenderer/OgreCEGUITexture.cpp