CrystalSpace

Public API Reference

csProcTexture Class Reference

Generic superclass for procedural textures. More...

#include <cstool/proctex.h>

Inheritance diagram for csProcTexture:

List of all members.

Public Member Functions

virtual void Animate (csTicks current_time)=0
 Animate this texture.
void DisableAutoUpdate ()
 Disable auto-update.
virtual void GetDimension (int &w, int &h) const
 get dimension
iTextureWrapperGetTextureWrapper ()
 Get the texture corresponding with this procedural texture.
virtual bool Initialize (iObjectRegistry *object_reg)
 Do everything needed to initialize this texture.
iMaterialWrapperInitialize (iObjectRegistry *object_reg, iEngine *engine, iTextureManager *txtmgr, const char *name)
 Initialize this procedural texture, create a material associated with it, properly register the texture and material and prepare them.
virtual bool PrepareAnim ()
 Prepare the animation for use.
void SetKeyColor (int red, int green, int blue)
 Set the key color to use for this texture.

Protected Member Functions

virtual iTextureWrapperCreateTexture (iObjectRegistry *object_reg)
 Create the actual texture wrapper.

Detailed Description

Generic superclass for procedural textures.

This class takes care of scheduling when a procedural texture needs updating.

Definition at line 64 of file proctex.h.


Member Function Documentation

virtual void csProcTexture::Animate ( csTicks  current_time  )  [pure virtual]

Animate this texture.

Subclasses of csProcTexture must implement this to implement some kind of animation on the procedural texture.

Implemented in csProcAnimated.

virtual iTextureWrapper* csProcTexture::CreateTexture ( iObjectRegistry object_reg  )  [protected, virtual]

Create the actual texture wrapper.

The default implementation creates a texture from proc_image if that is valid, or a texture of format "rgb8" otherwise. Override this function to realize different texture formats.

void csProcTexture::DisableAutoUpdate (  )  [inline]

Disable auto-update.

By default csProcTexture will register a callback so that every time the texture is visible Animate will automatically be called. If you don't want this and you want to call Animate on your own then you can disable this feature. You need to call DisableAutoUpdate() before calling Initialize().

Definition at line 164 of file proctex.h.

virtual void csProcTexture::GetDimension ( int &  w,
int &  h 
) const [inline, virtual]

get dimension

Definition at line 212 of file proctex.h.

iTextureWrapper* csProcTexture::GetTextureWrapper (  )  [inline]

Get the texture corresponding with this procedural texture.

Definition at line 221 of file proctex.h.

virtual bool csProcTexture::Initialize ( iObjectRegistry object_reg  )  [virtual]

Do everything needed to initialize this texture.

At this stage only will settings like the key color be used. The correct init sequence is:

Alternatively you can use Initialize(engine,name) which does all this work for you.

iMaterialWrapper* csProcTexture::Initialize ( iObjectRegistry object_reg,
iEngine engine,
iTextureManager txtmgr,
const char *  name 
)

Initialize this procedural texture, create a material associated with it, properly register the texture and material and prepare them.

This function assumes that the texture manager has already been set up. It is a convenience function that offers less flexibility but is sufficient for most cases. The texture and material will get the name that is given by this routine.

virtual bool csProcTexture::PrepareAnim (  )  [virtual]

Prepare the animation for use.

Reimplemented in csProcAnimated.

void csProcTexture::SetKeyColor ( int  red,
int  green,
int  blue 
) [inline]

Set the key color to use for this texture.

Definition at line 196 of file proctex.h.


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

Generated for Crystal Space 1.4.1 by doxygen 1.7.1