#include <Application.h>
Inheritance diagram for green::Application:
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 |
This enum is used for the mouse method to enumerate the mouse buttons.
This enum is used to enumerate the state of the mouse buttons
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
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.
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
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
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
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
renderSystem | The new RenderSystem for the Application. |