CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

iTextureHandle Struct Reference
[3D]

A texture handle as returned by iTextureManager. More...

#include <texture.h>

Inheritance diagram for iTextureHandle:

iBase List of all members.

Public Types

enum  
 Texture Depth Indices are used for Cubemap interface. More...


Public Methods

virtual int GetFlags ()=0
 Retrieve the flags set for this texture.

virtual void SetKeyColor (bool Enable)=0
 Enable key color.

virtual void SetKeyColor (uint8 red, uint8 green, uint8 blue)=0
 Set the key color.

virtual bool GetKeyColor ()=0
 Get the key color status (false if disabled, true if enabled).

virtual void GetKeyColor (uint8 &red, uint8 &green, uint8 &blue)=0
 Get the key color.

virtual bool GetMipMapDimensions (int mipmap, int &mw, int &mh)=0
 Get the dimensions for a given mipmap level (0 to 3).

virtual void GetOriginalDimensions (int &mw, int &mh)=0
 Return the original dimensions of the image used to create this texture.

virtual void GetMeanColor (uint8 &red, uint8 &green, uint8 &blue)=0
 Get the mean color.

virtual void * GetCacheData ()=0
 Get data associated internally with this texture by texture cache.

virtual void SetCacheData (void *d)=0
 Set data associated internally with this texture by texture cache.

virtual void * GetPrivateObject ()=0
 Query the private object associated with this handle.

virtual bool GetAlphaMap ()=0
 Query if the texture has an alpha channel.

virtual void Prepare ()=0
 Merge this texture into current palette, compute mipmaps and so on.

virtual iGraphics2DGetCanvas ()=0
 Get a canvas instance which is suitable for rendering on this texture.


Detailed Description

A texture handle as returned by iTextureManager.

Main creators of instances implementing this interface:

Main ways to get pointers to this interface: Main users of this interface:

Definition at line 55 of file texture.h.


Member Enumeration Documentation

anonymous enum
 

Texture Depth Indices are used for Cubemap interface.

Definition at line 99 of file texture.h.


Member Function Documentation

virtual bool iTextureHandle::GetAlphaMap   [pure virtual]
 

Query if the texture has an alpha channel.

This depends both on whenever the original image had an alpha channel and of the fact whenever the renderer supports alpha maps at all.

virtual void* iTextureHandle::GetCacheData   [pure virtual]
 

Get data associated internally with this texture by texture cache.

virtual iGraphics2D* iTextureHandle::GetCanvas   [pure virtual]
 

Get a canvas instance which is suitable for rendering on this texture.

Note that it is not allowed to change the palette of the returned canvas.

virtual int iTextureHandle::GetFlags   [pure virtual]
 

Retrieve the flags set for this texture.

virtual void iTextureHandle::GetKeyColor uint8   red,
uint8   green,
uint8   blue
[pure virtual]
 

Get the key color.

virtual bool iTextureHandle::GetKeyColor   [pure virtual]
 

Get the key color status (false if disabled, true if enabled).

virtual void iTextureHandle::GetMeanColor uint8   red,
uint8   green,
uint8   blue
[pure virtual]
 

Get the mean color.

virtual bool iTextureHandle::GetMipMapDimensions int    mipmap,
int &    mw,
int &    mh
[pure virtual]
 

Get the dimensions for a given mipmap level (0 to 3).

If the texture was registered just for 2D usage, mipmap levels above 0 will return false. Note that the result of this function will be the size that the renderer uses for this texture. In most cases this corresponds to the size that was used to create this texture but some renderers have texture size limitations (like power of two) and in that case the size returned here will be the corrected size. You can get the original image size with GetOriginalDimensions().

virtual void iTextureHandle::GetOriginalDimensions int &    mw,
int &    mh
[pure virtual]
 

Return the original dimensions of the image used to create this texture.

This is most often equal to GetMipMapDimensions (0, mw, mh) but in some cases the texture will have been resized in order to accomodate hardware restrictions (like power of two and maximum texture size). This function returns the uncorrected coordinates.

virtual void* iTextureHandle::GetPrivateObject   [pure virtual]
 

Query the private object associated with this handle.

For internal usage by the 3D driver.

virtual void iTextureHandle::Prepare   [pure virtual]
 

Merge this texture into current palette, compute mipmaps and so on.

You should call either Prepare() or iTextureManager::PrepareTextures() before using any texture. Note that it is in this stage that the original image that is attached to a texture is scaled so that it fits hardware requirements. So it is important to realize that calling this function may actually change the image from which you created this texture!

virtual void iTextureHandle::SetCacheData void *    d [pure virtual]
 

Set data associated internally with this texture by texture cache.

virtual void iTextureHandle::SetKeyColor uint8    red,
uint8    green,
uint8    blue
[pure virtual]
 

Set the key color.

virtual void iTextureHandle::SetKeyColor bool    Enable [pure virtual]
 

Enable key color.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.18