CrystalSpace

Public API Reference

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

csProcTexture Class Reference

Generic superclass for procedural textures. More...

#include <proctex.h>

Inheritance diagram for csProcTexture:

csObject iObject iBase csProcDots csProcFire csProcPlasma csProcSkyTexture csProcWater List of all members.

Public Methods

void DisableAutoUpdate ()
 Disable auto-update. More...

virtual bool Initialize (iObjectRegistry *object_reg)
 Do everything needed to initialize this texture. More...

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. More...

virtual bool PrepareAnim ()
 Prepare the animation for use. More...

void SetKeyColor (int red, int green, int blue)
 Set the key color to use for this texture. More...

virtual void Animate (csTicks current_time)=0
 Animate this texture. More...

virtual void GetDimension (int &w, int &h)
 get dimension. More...

iTextureWrapperGetTextureWrapper ()
 Get the texture corresponding with this procedural texture. More...


Detailed Description

Generic superclass for procedural textures.

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

Definition at line 46 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 csProcDots.

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 145 of file proctex.h.

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

get dimension.

Definition at line 197 of file proctex.h.

iTextureWrapper* csProcTexture::GetTextureWrapper   [inline]
 

Get the texture corresponding with this procedural texture.

Definition at line 206 of file proctex.h.

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 and PrepareTextures has already been called for the other loaded textures. 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::Initialize iObjectRegistry   object_reg [virtual]
 

Do everything needed to initialize this texture.

At this stage only will settings like the key color be used. After Initialize has been called you can call Prepare() on the texture handle or PrepareTextures. The correct init sequence is:

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

virtual bool csProcTexture::PrepareAnim   [virtual]
 

Prepare the animation for use.

This needs to be done after the texture has been prepared.

Reimplemented in csProcDots.

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

Set the key color to use for this texture.

Definition at line 182 of file proctex.h.


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