Main Page   Modules   Class Hierarchy   Compound List   Compound Members  

GAUGE3D::GScheduler Class Reference

#include <gauge3d/scheduler.h>

Inherits GAUGE3D::GObject.

List of all members.

Public Methods

 GScheduler ()
 Constructor.

 ~GScheduler ()
 Destructor.

void CallEveryFrame (GObject *object,int priority=0)
 Tell the scheduler to call object->DoFrame() every frame. More...

void StopCallingEveryFrame (GObject *object)
 Remove the object from the list of objects to call every frame.

int GetObjectPriority (GObject *object)
 Get the priority of an object on the call every frame list.

void SetObjectPriority (GObject *object,int priority)
 Change the priority of an object on the call every frame list.

virtual void DoFrame (tTime time,tTime frametime)
 Call the DoFrame() functions for all objects which requested it. More...

tTime Time ()
 Get the current time.

tTime FrameTime ()
 Get the amount of time spent processing the previous frame.


Detailed Description

\breif Schedules events.

GScheduler is used to synchronize events throughout the engine. Each subsystem has a scheduler for events which relate to that subsystem. Many classes which are part of that subsystem will register themselves with the scheduler. Then, the scheduler will call those objects' DoFrame() functions every frame.

For example, when you create a GDisplay and give it a GCamera to render from, you do not have to tell it when to render each frame. This is because the GDisplay asks gVideoScheduler to call it every frame. When it gets called back by gVideoScheduler, the GDisplay renders the scene.


Member Function Documentation

void GAUGE3D::GScheduler::CallEveryFrame ( GObject * object,
int priority = 0 )
 

Tell the scheduler to call object->DoFrame() every frame.

Parameters:
priority   This value can optionally be used to tell the scheduler in what order to call objects. Objects with lower priorities will be called earlier in the frame.
Remarks:
Typically, this function will be called by the constructor of an object, and StopCallingEveryFrame() will be called by the destructor.

void GAUGE3D::GScheduler::DoFrame ( tTime time,
tTime frametime ) [virtual]
 

Call the DoFrame() functions for all objects which requested it.

Parameters:
time   The current time.
frametime   The amount of time spent processing the previous frame.

This function is normally called by GEngine::MainLoop().

Reimplemented from GAUGE3D::GObject.


The documentation for this class was generated from the following file:
Generated at Tue Jan 30 17:07:34 2001 for gauge3d by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000