Crystal Space: iTextureWrapper Struct Reference (Crystal Space Public API Reference)

| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iTextureWrapper Struct Reference
[Textures & Materials]

A texture wrapper is an engine-level object that wraps around an actual texture (iTextureHandle). More...

`#include <iengine/texture.h>`

Inheritance diagram for iTextureWrapper:

[legend]
List of all members.

## Public Member Functions
virtual iTextureWrapper * | Clone () const =0
| Create a clone this texture wrapper, using the same texture handle.
virtual int | GetFlags () const =0
| Return the flags which are used to register the texture.
virtual iImage * | GetImageFile ()=0
| Get the iImage.
virtual void | GetKeyColor (int &red, int &green, int &blue) const =0
| Query the transparent color.
virtual const char * | GetTextureClass ()=0
| Get the "class" of this texture.
virtual iTextureHandle * | GetTextureHandle ()=0
| Get the texture handle.
virtual iTextureCallback * | GetUseCallback () const =0
| Get the use callback.
virtual bool | IsVisitRequired () const =0
| Return true if it is needed to call Visit().
virtual bool | KeepImage () const =0
| If this flag is true then the image will be kept even after calling Register.
virtual iObject * | QueryObject ()=0
| Get the iObject for this texture.
virtual void | Register (iTextureManager *txtmng)=0
| Register the texture with the texture manager.
virtual void | SetFlags (int flags)=0
| Set the flags which are used to register the texture.
virtual void | SetImageFile (iImage *Image)=0
| Change the base iImage.
virtual void | SetKeepImage (bool k)=0
| Set the keep image flag.
virtual void | SetKeyColor (int red, int green, int blue)=0
| Set the transparent color.
virtual void | SetTextureClass (const char *className)=0
| Set the "class" of this texture.
virtual void | SetTextureHandle (iTextureHandle *tex)=0
| Change the texture handle.
virtual void | SetUseCallback (iTextureCallback *callback)=0
| Set a callback which is called just before the texture is used.
virtual void | Visit ()=0
| Visit this texture.

## Detailed Description

A texture wrapper is an engine-level object that wraps around an actual texture (iTextureHandle).

Every texture in the engine is represented by a texture wrapper, which keeps the pointer to the texture handle, its name, and possibly the base image object.

Main creators of instances implementing this interface:

- iEngine::CreateTexture()
- iEngine::CreateBlackTexture()
- iTextureList::NewTexture()
- iLoader::LoadTexture()

Main ways to get pointers to this interface:

- iEngine::FindTexture()
- iTextureList::Get()
- iTextureList::FindByName()
- iLoaderContext::FindTexture()
- iLoaderContext::FindNamedTexture()
- iMaterialEngine::GetTextureWrapper()

Main users of this interface:

- iEngine

Definition at line 73 of file texture.h.

## Member Function Documentation

virtual iTextureWrapper* iTextureWrapper::Clone | ( |  | ) | const`[pure virtual]`

Create a clone this texture wrapper, using the same texture handle.

Implemented in csProcTexture.

virtual int iTextureWrapper::GetFlags | ( |  | ) | const`[pure virtual]`

Return the flags which are used to register the texture.

Implemented in csProcTexture.

virtual iImage* iTextureWrapper::GetImageFile | ( |  | ) | `[pure virtual]`

Get the iImage.

Implemented in csProcTexture.

virtual void iTextureWrapper::GetKeyColor | ( | int & | red,
|  | int & | green,
|  | int & | blue |
| ) |  |  | const`[pure virtual]`

Query the transparent color.

Implemented in csProcTexture.

virtual const char* iTextureWrapper::GetTextureClass | ( |  | ) | `[pure virtual]`

Get the "class" of this texture.

For more information, see iTextureHandle::GetTextureClass.

Implemented in csProcTexture.

virtual iTextureHandle* iTextureWrapper::GetTextureHandle | ( |  | ) | `[pure virtual]`

Get the texture handle.

Implemented in csProcTexture.

virtual iTextureCallback* iTextureWrapper::GetUseCallback | ( |  | ) | const`[pure virtual]`

Get the use callback.

If there are multiple use callbacks you can use this function to chain.

Implemented in csProcTexture.

virtual bool iTextureWrapper::IsVisitRequired | ( |  | ) | const`[pure virtual]`

Return true if it is needed to call Visit().

Implemented in csProcTexture.

virtual bool iTextureWrapper::KeepImage | ( |  | ) | const`[pure virtual]`

If this flag is true then the image will be kept even after calling Register.

If this flag is false then Register() will remove the image pointer from this texture wrapper. False by default.

Implemented in csProcTexture.

virtual iObject* iTextureWrapper::QueryObject | ( |  | ) | `[pure virtual]`

Get the iObject for this texture.

Implemented in csProcTexture.

virtual void iTextureWrapper::Register | ( | iTextureManager * | txtmng | ) | `[pure virtual]`

Register the texture with the texture manager.

Implemented in csProcTexture.

virtual void iTextureWrapper::SetFlags | ( | int | flags | ) | `[pure virtual]`

Set the flags which are used to register the texture.

Implemented in csProcTexture.

virtual void iTextureWrapper::SetImageFile | ( | iImage * | Image | ) | `[pure virtual]`

Change the base iImage.

The changes will not be visible until the texture is registered again.

Implemented in csProcTexture.

virtual void iTextureWrapper::SetKeepImage | ( | bool | k | ) | `[pure virtual]`

Set the keep image flag.

See KeepImage() function for explanation.

Implemented in csProcTexture.

virtual void iTextureWrapper::SetKeyColor | ( | int | red,
|  | int | green,
|  | int | blue |
| ) |  |  | `[pure virtual]`

Set the transparent color.

Implemented in csProcTexture.

virtual void iTextureWrapper::SetTextureClass | ( | const char * | className | ) | `[pure virtual]`

Set the "class" of this texture.

For more information, see iTextureHandle::SetTextureClass.

Implemented in csProcTexture.

virtual void iTextureWrapper::SetTextureHandle | ( | iTextureHandle * | tex | ) | `[pure virtual]`

Change the texture handle.

The changes will immediatly be visible. This will also change the key color and registration flags to those of the new texture and the iImage to 0.

Implemented in csProcTexture.

virtual void iTextureWrapper::SetUseCallback | ( | iTextureCallback * | callback | ) | `[pure virtual]`

Set a callback which is called just before the texture is used.

This is mainly useful for procedural textures which can then choose to update their image.

Implemented in csProcTexture.

virtual void iTextureWrapper::Visit | ( |  | ) | `[pure virtual]`

Visit this texture.

This should be called by the engine right before using the texture. It is responsible for calling the use callback if there is one.

Implemented in csProcTexture.

The documentation for this struct was generated from the following file:

- iengine/texture.h