CTimer Class Reference

#include <CTimer.h>

Inheritance diagram for CTimer:

ITimer IrrUnknown

Public Member Functions

Protected Member Functions


Constructor & Destructor Documentation

CTimer (  )  [inline]


Member Function Documentation

bool drop (  )  [inline, inherited]

Drops the object. Decrements the reference counter by one. Returns true, if the object was deleted. The IrrUnknown class provides a basic reference counting mechanism with its methods grab() and drop(). Most objects of the Irrlicht Engine are derived from IrrUnknown, and so they are reference counted.

When you create an object in the Irrlicht engine, calling a method which starts with 'create', an object is created, and you get a pointer to the new object. If you no longer need the object, you have to call drop(). This will destroy the object, if grab() was not called in another part of you program, because this part still needs the object. Note, that you only need to call drop() to the object, if you created it, and the method had a 'create' in it.

A simple example:

If you want to create a texture, you may want to call an imaginable method IDriver::createTexture. You call ITexture* texture = driver->createTexture(dimension2d<s32>(128, 128)); If you no longer need the texture, call texture->drop(). If you want to load a texture, you may want to call imaginable method IDriver::loadTexture. You do this like ITexture* texture = driver->loadTexture("example.jpg"); You will not have to drop the pointer to the loaded texture, because the name of the method does not start with 'create'. The texture is stored somewhere by the driver.

const c8* getDebugName (  )  const [inline, inherited]

Returns the debug name of the object. The Debugname may only be set and changed by the object itself. This method should only be used in Debug mode.

Returns:
Returns a string, previously set by setDebugName();

virtual u32 getRealTime (  )  [inline, virtual]

This value does not start with 0 when the application starts. For example in one implementation the value returned could be the amount of milliseconds which have elapsed since the system was started.

Implements ITimer.

virtual f32 getSpeed (  )  [inline, virtual]

The speed is the factor with which the time is running faster or slower then the real system time.

Implements ITimer.

virtual u32 getTime (  )  [inline, virtual]

This value starts with 0 and can be manipulated using setTime(), stopTimer(), startTimer(), etc. This value depends on the set speed of the timer if the timer is stopped, etc. If you need the system time, use getRealTime()

Implements ITimer.

void grab (  )  [inline, inherited]

Grabs the object. Increments the reference counter by one. Someone who calls grab() to an object, should later also call drop() to it. If an object never gets as much drop() as grab() calls, it will never be destroyed. The IrrUnknown class provides a basic reference counting mechanism with its methods grab() and drop(). Most objects of the Irrlicht Engine are derived from IrrUnknown, and so they are reference counted.

When you create an object in the Irrlicht engine, calling a method which starts with 'create', an object is created, and you get a pointer to the new object. If you no longer need the object, you have to call drop(). This will destroy the object, if grab() was not called in another part of you program, because this part still needs the object. Note, that you only need to call drop() to the object, if you created it, and the method had a 'create' in it.

A simple example:

If you want to create a texture, you may want to call an imaginable method IDriver::createTexture. You call ITexture* texture = driver->createTexture(dimension2d<s32>(128, 128)); If you no longer need the texture, call texture->drop(). If you want to load a texture, you may want to call imaginable method IDriver::loadTexture. You do this like ITexture* texture = driver->loadTexture("example.jpg"); You will not have to drop the pointer to the loaded texture, because the name of the method does not start with 'create'. The texture is stored somewhere by the driver.

virtual bool isStopped (  )  [inline, virtual]

Implements ITimer.

void setDebugName ( const c8 newName  )  [inline, protected, inherited]

Sets the debug name of the object. The Debugname may only be set and changed by the object itself. This method should only be used in Debug mode.

Parameters:
newName,: New debug name to set.

virtual void setSpeed ( f32  speed = 1.0f  )  [inline, virtual]

The speed is the factor with which the time is running faster or slower then the real system time.

Implements ITimer.

virtual void setTime ( u32  time  )  [inline, virtual]

Implements ITimer.

virtual void start (  )  [inline, virtual]

The timer is reference counted, which means everything which calls stopTimer() will also have to call startTimer(), otherwise the timer may not start/stop corretly again.

Implements ITimer.

virtual void stop (  )  [inline, virtual]

The timer is reference counted, which means everything which calls stopTimer() will also have to call startTimer(), otherwise the timer may not start/stop corretly again.

Implements ITimer.

virtual void tick (  )  [inline, virtual]

Makes the virtual timer update the time value based on the real time. This is called automaticly when calling IrrlichtDevice::run(), but you can call it manually if you don't use this method.

Implements ITimer.


Generated on Fri Apr 27 14:47:02 2007 for IrrSpintz by  doxygen 1.5.1-p1