#include <Demo.h>
Public Member Functions | |
Demo () | |
~Demo () | |
void | Init (int argc, char *argv[]) |
void | Play () |
void | AddScene (Scene *scene, int duration, int blend_in) |
Private Types | |
typedef Demo::SceneListElem | SceneList |
Private Member Functions | |
void | SwitchMonitor () |
void | SwitchPlayback () |
void | UpdateTime () |
void | PrintUsage () |
void | DisplayLoop () |
void | IdleLoop () |
void | Reshape (int w, int h) |
void | Keyboard (unsigned char key, int x, int y) |
void | KeyboardSpecial (int key, int x, int y) |
void | SetGlobalAmbientPlayback (float red, float green, float blue, float alpha) |
void | SetGlobalAmbientMonitor (float red, float green, float blue, float alpha) |
void | SetGlobalSpecularReflection (float red, float green, float blue, float alpha) |
void | SetGlobalShininess (int shininess) |
Static Private Member Functions | |
static void | static_display () |
static void | static_idle () |
static void | static_reshape (int w, int h) |
static void | static_keyboard (unsigned char key, int x, int y) |
static void | static_keyboard_special (int key, int x, int y) |
Private Attributes | |
bool | is_initialized |
int | window_width |
int | window_height |
bool | fullscreen_enabled |
int | culling_mode |
bool | level_of_detail_enabled |
bool | monitoring_mode |
bool | demo_playing |
Camera * | monitor_camera |
int | demo_time |
int | last_measure_time |
int | frame_rate |
int | last_frame_rate_time |
int | incremental_rate |
char | buffer [200] |
SceneList * | first_scene |
SceneListElem * | current_scene |
float | global_ambient_playback [4] |
float | global_ambient_monitor [4] |
float | global_specular_reflection [4] |
int | global_shininess |
Static Private Attributes | |
static Demo * | current_demo = NULL |
Classes | |
struct | SceneListElem |
This is the main class. When the demo is played, a sequence of scenes are rendered either in fullscreen mode or in a window of an arbitrary size. The demo supports blending between scenes using the OpenGL accumulation buffer. Apart from the ability to start and stop the playback of the demo it also provides a mechanism to monitor the scenes. When entering this monitoring mode, playback of the demo is stopped and the camera may be moved around freely. Additionally, the bounding volumes that are currently used to apply view frustum culling are displayed as well as the camera that captures the scene and its view frustum. Furthermore, all the objects are drawn with the level of detail that it used for the camera that captures the scene.
The demo also contains some basic properties for illumination that are common to all scenes, such as the minimal ambient light during playback and during monitoring mode or the properties of the specular reflections.
Definition at line 38 of file Demo.h.
|
Data structure to hold the scenes. |
|
Constructor: Brings the demo into a consistent state. |
|
Destructor: Frees ressources needed by the demo |
|
Adds a scene to the demo. The duration of this scene as well as the time needed to blend in the scene can be specified manually.
|
|
The display loop of the demo. Handles the drawing of the scenes. |
|
Idle loop, does nothing. |
|
Initializes the demo, its scenes and OpenGL states.
|
|
Keyboard function, called whenever a regular keyboard key is pressed.
|
|
Special keyboard input function, called whenever a special keyboard key is pressed.
|
|
Starts the playback of the demo. |
|
Prints a short description to the console. |
|
Reshape function, called whenever the display window gets resized.
|
|
Sets the global ambient illumination when monitor mode.
|
|
Sets the global ambient illumination when not in monitoring mode.
|
|
Sets the shininess of all the specular reflections.
|
|
Sets the global specular reflection.
|
|
This static function is required by glut. |
|
This static function is required by glut. |
|
This static function is required by glut. |
|
This static function is required by glut. |
|
This static function is required by glut. |
|
Switches monitoring mode on respectively off. |
|
Switches playback on respectively off. |
|
Updates the elapsed demo time. The time in only increased if the demo is actually playing. |
|
Buffer used for string creation. |
|
Describes the mode currently used for view frustum culling: C_NONE, C_BOUNDING_BOX, C_SPHERE or C_MIXED. |
|
This static variable determines the currently active demo. |
|
Pointer to the currently active scene during playback. |
|
States if the demo is currently playing. |
|
Actual time of the demo in milliseconds |
|
List constaining all the scenes of the demo. |
|
Current frame rate. |
|
States if the demo is in fullscreen_mode. NOT YET SUPPORTED. |
|
Global ambient light when in monitoring mode. |
|
Global ambient light when not in monitoring mode. |
|
Global shininess value. |
|
Global specular reflection. |
|
Simple counter used for the frame rate calculation. |
|
States if the demo has been initialized or not |
|
States when the frame rate was evaluated for the last time. |
|
Last valid time measurement used to update the demo time. |
|
States if objects shall be drawn using different levels of detail. |
|
The camera used to monitor the scenes of the demo. |
|
States if the demo is currently running in monitoring mode. |
|
Screen height of the demo. |
|
Screen width of the demo. |