Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Moteur3D::AppStarter_3DApplication Class Reference

AppStarter_3DApplication is an application starter that gives you the required minimum to start an application. It consists in a blank window, functions to handle this window as well as inputs (mouse and keyboard) and events (resize, draw...). Most if not all of these functions are overridable. More...

#include <AppStarter_3DApplication.h>

Inheritance diagram for Moteur3D::AppStarter_3DApplication:

Moteur3D::IEventManager Moteur3D::AppStarter_ObjectViewer List of all members.

Public Member Functions

 AppStarter_3DApplication (WindowParams *params)
 Constructor.
 ~AppStarter_3DApplication ()
 Destructor.
virtual void Start ()
 Starts the window and its features. this involves creating and showing the window, initializing all the openGL stuff, and running the main loop. IMPORTANT : this function, as it calls function Run(), does NOT return until the window is closed. Once you're in, you can still control your app inside OnRenderScene and OnIdle, for example.
virtual void Stop ()
 Stops the execution of the Run() function (if it's running). This also affects Start().
virtual void ShowWindow ()
 Shows the window if it can be shown and is currently hidden. Else does nothing.
virtual void HideWindow ()
 Hides the window if it can be hidden and is currently shown. Else does nothing.

Protected Member Functions

virtual bool InitWindow (int width, int height, int bitsPerPixel, char *name, bool fullScreen)
 Initialises the window with the parameters given.
virtual void InitGL ()
 Initialises all the OpenGL stuff such as modelview matrix, Z-buffer and so on.
virtual void Run ()
 This is the main loop. it does NOT return until the window is closed, and must be called if you want the whole window stuff to work.
virtual void OnRenderScene ()
 This function is called when the display needs a new frame to be rendered. Put all display stuff in it.
virtual void OnIdle ()
 This function is called just before OnRenderScene(). Put any code you want in it, generally application management stuff.
virtual void OnResize (short width, short height)
 This function is called every time the window is resized. It modifies OpenGL's viewport.
virtual void OnKey (KeyList key, bool keyDown)
 This function is called every time the user presses a key.
virtual void OnMouseMove (const MouseInformations *mouseInfo)
 This function is called every time the mouse is moved inside the window's borders.
virtual void OnMouseButton (const MouseInformations *mouseInfo, MouseButton button, bool buttonDown)
 This function is called every time a mouse button is pressed or released inside the window's borders.
virtual void OnMouseWheel (const MouseInformations *mouseInfo, short displacement)
 This function is called every time the wheel is used inside the window's borders.

Protected Attributes

KeyPressed m_KeysPressed
 Variable that remembers which special keys are held down.
Windowm_Window
 Internal window's management.
int m_Width
 Window's current width.
int m_Height
 Window's current height.

Detailed Description

AppStarter_3DApplication is an application starter that gives you the required minimum to start an application. It consists in a blank window, functions to handle this window as well as inputs (mouse and keyboard) and events (resize, draw...). Most if not all of these functions are overridable.


Constructor & Destructor Documentation

Moteur3D::AppStarter_3DApplication::AppStarter_3DApplication WindowParams *  params  ) 
 

Constructor.

Parameters:
params Windows parameters needed for instanciation

Moteur3D::AppStarter_3DApplication::~AppStarter_3DApplication  ) 
 

Destructor.


Member Function Documentation

virtual void Moteur3D::AppStarter_3DApplication::HideWindow  )  [virtual]
 

Hides the window if it can be hidden and is currently shown. Else does nothing.

virtual void Moteur3D::AppStarter_3DApplication::InitGL  )  [protected, virtual]
 

Initialises all the OpenGL stuff such as modelview matrix, Z-buffer and so on.

Reimplemented in Moteur3D::AppStarter_ObjectViewer.

virtual bool Moteur3D::AppStarter_3DApplication::InitWindow int  width,
int  height,
int  bitsPerPixel,
char *  name,
bool  fullScreen
[protected, virtual]
 

Initialises the window with the parameters given.

Parameters:
width Window render's width. Does not include window borders.
height Window render's height. Does not include window borders.
bitsPerPixel number of bits per pixel. Usually 16, 24 or 32.
name window's name, to be (generally) displayed in the top border.
fullScreen will the window be displayed in fullscreen mode ?

virtual void Moteur3D::AppStarter_3DApplication::OnIdle  )  [protected, virtual]
 

This function is called just before OnRenderScene(). Put any code you want in it, generally application management stuff.

Implements Moteur3D::IEventManager.

virtual void Moteur3D::AppStarter_3DApplication::OnKey KeyList  key,
bool  keyDown
[protected, virtual]
 

This function is called every time the user presses a key.

Parameters:
key Key pressed.
keyDown true if the key has been pressed, false if it has been released.

Implements Moteur3D::IEventManager.

virtual void Moteur3D::AppStarter_3DApplication::OnMouseButton const MouseInformations mouseInfo,
MouseButton  button,
bool  buttonDown
[protected, virtual]
 

This function is called every time a mouse button is pressed or released inside the window's borders.

Parameters:
mouseInfo Mouse informations, such as position, button states etc.
button Mouse button that is concerned.
buttonDown true if the button is being pressed, otherwise false.

Implements Moteur3D::IEventManager.

virtual void Moteur3D::AppStarter_3DApplication::OnMouseMove const MouseInformations mouseInfo  )  [protected, virtual]
 

This function is called every time the mouse is moved inside the window's borders.

Parameters:
mouseInfo mouse informations, such as position, button states etc.

Implements Moteur3D::IEventManager.

Reimplemented in Moteur3D::AppStarter_ObjectViewer.

virtual void Moteur3D::AppStarter_3DApplication::OnMouseWheel const MouseInformations mouseInfo,
short  displacement
[protected, virtual]
 

This function is called every time the wheel is used inside the window's borders.

Parameters:
mouseInfo Mouse informations, such as position, button states etc.
displacement wheel displacement. Is a multiple of 120, and can be positive or negative depending on the wheel's rotation.

Implements Moteur3D::IEventManager.

Reimplemented in Moteur3D::AppStarter_ObjectViewer.

virtual void Moteur3D::AppStarter_3DApplication::OnRenderScene  )  [protected, virtual]
 

This function is called when the display needs a new frame to be rendered. Put all display stuff in it.

Implements Moteur3D::IEventManager.

Reimplemented in Moteur3D::AppStarter_ObjectViewer.

virtual void Moteur3D::AppStarter_3DApplication::OnResize short  width,
short  height
[protected, virtual]
 

This function is called every time the window is resized. It modifies OpenGL's viewport.

Parameters:
width New window's width.
height New window's height.

Implements Moteur3D::IEventManager.

virtual void Moteur3D::AppStarter_3DApplication::Run  )  [protected, virtual]
 

This is the main loop. it does NOT return until the window is closed, and must be called if you want the whole window stuff to work.

virtual void Moteur3D::AppStarter_3DApplication::ShowWindow  )  [virtual]
 

Shows the window if it can be shown and is currently hidden. Else does nothing.

virtual void Moteur3D::AppStarter_3DApplication::Start  )  [virtual]
 

Starts the window and its features. this involves creating and showing the window, initializing all the openGL stuff, and running the main loop. IMPORTANT : this function, as it calls function Run(), does NOT return until the window is closed. Once you're in, you can still control your app inside OnRenderScene and OnIdle, for example.

Reimplemented in Moteur3D::AppStarter_ObjectViewer.

virtual void Moteur3D::AppStarter_3DApplication::Stop  )  [virtual]
 

Stops the execution of the Run() function (if it's running). This also affects Start().


Member Data Documentation

int Moteur3D::AppStarter_3DApplication::m_Height [protected]
 

Window's current height.

KeyPressed Moteur3D::AppStarter_3DApplication::m_KeysPressed [protected]
 

Variable that remembers which special keys are held down.

int Moteur3D::AppStarter_3DApplication::m_Width [protected]
 

Window's current width.

Window* Moteur3D::AppStarter_3DApplication::m_Window [protected]
 

Internal window's management.


The documentation for this class was generated from the following file:
Generated on Sat Oct 15 15:05:51 2005 for Moteur3D by  doxygen 1.4.4