green::Application Class Reference

#include <Application.h>

Inheritance diagram for green::Application:

green::GRunApplication List of all members.

Public Types

enum  MouseButton { LEFT_BUTTON, MIDDLE_BUTTON, RIGHT_BUTTON }
enum  MouseState { UP, DOWN }

Public Member Functions

virtual void Init ()
virtual void display ()
virtual void reshape (int width, int height)
virtual void motion (int x, int y)
virtual void mouse (MouseButton button, MouseState state, int x, int y)
virtual void keyboard (unsigned char ch, int x, int y)
virtual void keyboard_up (unsigned char ch, int x, int y)
virtual void SetRenderSystem (RenderSystemPtr renderSystem)

Protected Attributes

RenderSystemPtr mRenderSystem

Detailed Description

The Application class is the pure virtual base class which is driven by a rendering system/event loop backend, such as glutApp. The backend calls the appropriate methods in an Application subclass at specific times to drive the application.


Member Enumeration Documentation

enum green::Application::MouseButton

This enum is used for the mouse method to enumerate the mouse buttons.

enum green::Application::MouseState

This enum is used to enumerate the state of the mouse buttons


Member Function Documentation

virtual void green::Application::Init (  )  [inline, virtual]

Initialize the application

Reimplemented in green::GRunApplication.

virtual void green::Application::display (  )  [inline, virtual]

Display is called when the window/screen needs to be drawn/updated

Reimplemented in green::GRunApplication.

virtual void green::Application::reshape ( int  width,
int  height 
) [inline, virtual]

reshape is drawn whenever the size of the window/screen changes

Parameters:
width the new width of the window
height the new height of the window

virtual void green::Application::motion ( int  x,
int  y 
) [inline, virtual]

motion is called whenever the mouse moves while one or more mouse buttons are pressed.

Parameters:
x the new x coordinate of the mouse in window-relative coords
y the new y coordinate of the mouse in window-relative coords

virtual void green::Application::mouse ( MouseButton  button,
MouseState  state,
int  x,
int  y 
) [inline, virtual]

mouse is called when a mouse button is clicked or released

Parameters:
button is the button that was pressed, ie: GLUT_LEFT_BUTTON, GLUT_MIDDLE_BUTTON, GLUT_RIGHT_BUTTON
state This is whether the mouse was clicked or released, ie: GLUT_DOWN, GLUT_UP resepectively
x the x coordinate of the mouse in window-relative coords
y the y coordinate of the mouse in window-relative coords

virtual void green::Application::keyboard ( unsigned char  ch,
int  x,
int  y 
) [inline, virtual]

this function is called when an key is pressed down it only supports keys that generate ascii characters

Parameters:
ch This is the ascii character generated by the key
x the x coordinate of the mouse in window-relative coords
y the y coordinate of the mouse in window-relative coords

Reimplemented in green::GRunApplication.

virtual void green::Application::keyboard_up ( unsigned char  ch,
int  x,
int  y 
) [inline, virtual]

this function is called when a key is released it only supports keys that generate ascii characters

Parameters:
ch This is the ascii character generated by the key
x the x coordinate of the mouse in window-relative coords
y the y coordinate of the mouse in window-relative coords

Reimplemented in green::GRunApplication.

virtual void green::Application::SetRenderSystem ( RenderSystemPtr  renderSystem  )  [inline, virtual]

Set the RenderSystem for this Application

Parameters:
renderSystem The new RenderSystem for the Application.


The documentation for this class was generated from the following file:
Generated on Fri Apr 27 10:27:38 2007 for Green Engine by  doxygen 1.5.1