Crazy Eddies GUI System  0.6.0
Public Types | Public Member Functions | Protected Member Functions | List of all members
CEGUI::Texture Class Referenceabstract

Abstract base class specifying the required interface for Texture objects. More...

Public Types

enum  PixelFormat { PF_RGB, PF_RGBA }
 Enum containing the list of supported pixel formats that can be passed to loadFromMemory. More...
 

Public Member Functions

virtual ushort getWidth (void) const =0
 Returns the current pixel width of the texture. More...
 
virtual ushort getOriginalWidth (void) const
 Returns the original pixel width of the data loaded into the texture. More...
 
virtual float getXScale (void) const
 Returns the current scale used for the width of the texture. More...
 
virtual ushort getHeight (void) const =0
 Returns the current pixel height of the texture. More...
 
virtual ushort getOriginalHeight (void) const
 Returns the original pixel height of the data loaded into the texture. More...
 
virtual float getYScale (void) const
 Returns the current scale used for the height of the texture. More...
 
virtual void loadFromFile (const String &filename, const String &resourceGroup)=0
 Loads the specified image file into the texture. The texture is resized as required to hold the image. More...
 
virtual void loadFromMemory (const void *buffPtr, uint buffWidth, uint buffHeight, PixelFormat pixelFormat)=0
 Loads (copies) an image in memory into the texture. The texture is resized as required to hold the image. More...
 
RenderergetRenderer (void) const
 Return a pointer to the Renderer object that created and owns this Texture. More...
 

Protected Member Functions

 Texture (Renderer *owner)
 Constructor for Texture base class. This is never called by client code.
 
virtual ~Texture (void)
 Destructor for Texture base class. This is never called by client code.
 

Detailed Description

Abstract base class specifying the required interface for Texture objects.

Texture objects are created via the Renderer. The actual inner workings of any Texture object are dependant upon the Renderer (and underlying API) in use. This base class defines the minimal set of functions that is required for the rest of the system to work. Texture objects are only created through the Renderer object's texture creation functions.

Member Enumeration Documentation

Enum containing the list of supported pixel formats that can be passed to loadFromMemory.

Enumerator
PF_RGB 

Each pixel is 3 bytes. RGB in that order.

PF_RGBA 

Each pixel is 4 bytes. RGBA in that order.

Member Function Documentation

virtual ushort CEGUI::Texture::getHeight ( void  ) const
pure virtual

Returns the current pixel height of the texture.

Returns
ushort value that is the current height of the texture in pixels
virtual ushort CEGUI::Texture::getOriginalHeight ( void  ) const
inlinevirtual

Returns the original pixel height of the data loaded into the texture.

Returns
ushort value that is the original height, in pixels, of the data last loaded into the texture.
Note
for compatibility reason this method is optional the auto scale issue mantis ticket # 0000045 is not fixed for renderer that do not handle this.
virtual ushort CEGUI::Texture::getOriginalWidth ( void  ) const
inlinevirtual

Returns the original pixel width of the data loaded into the texture.

Returns
ushort value that is the original width, in pixels, of the data last loaded into the texture.
Note
for compatibility reason this method is optional the auto scale issue mantis ticket # 0000045 is not fixed for renderer that do not handle this.
Renderer* CEGUI::Texture::getRenderer ( void  ) const
inline

Return a pointer to the Renderer object that created and owns this Texture.

Returns
Pointer to the Renderer object that owns the Texture

Referenced by CEGUI::Imageset::draw().

virtual ushort CEGUI::Texture::getWidth ( void  ) const
pure virtual

Returns the current pixel width of the texture.

Returns
ushort value that is the current width of the texture in pixels
virtual float CEGUI::Texture::getXScale ( void  ) const
inlinevirtual

Returns the current scale used for the width of the texture.

Returns
float value that denotes the horizontal scaling required to accurately map pixel positions to texture co-ords.

Referenced by CEGUI::Imageset::draw().

virtual float CEGUI::Texture::getYScale ( void  ) const
inlinevirtual

Returns the current scale used for the height of the texture.

Returns
float value that denotes the vertical scaling required to accurately map pixel positions to texture co-ords.

Referenced by CEGUI::Imageset::draw().

virtual void CEGUI::Texture::loadFromFile ( const String filename,
const String resourceGroup 
)
pure virtual

Loads the specified image file into the texture. The texture is resized as required to hold the image.

Parameters
filenameThe filename of the image file that is to be loaded into the texture
resourceGroupResource group identifier to be passed to the resource provider when loading the image file.
Returns
Nothing.
virtual void CEGUI::Texture::loadFromMemory ( const void *  buffPtr,
uint  buffWidth,
uint  buffHeight,
PixelFormat  pixelFormat 
)
pure virtual

Loads (copies) an image in memory into the texture. The texture is resized as required to hold the image.

Parameters
buffPtrPointer to the buffer containing the image data
buffWidthWidth of the buffer (in pixels as specified by pixelFormat )
buffHeightHeight of the buffer (in pixels as specified by pixelFormat )
pixelFormatPixelFormat value describing the format contained in buffPtr
Returns
Nothing.

Referenced by CEGUI::FreeTypeFont::rasterize().