#include <glutApp.h>
Public Member Functions | |
glutApp () | |
int | CreateWindow (std::string name, unsigned int displayMode, int width, int height) |
virtual void | RegisterGLUTCallbacks () |
void | SetCurrent (ApplicationPtr app) |
virtual void | Init () |
virtual void | Run () |
int | WindowWidth () const |
int | WindowHeight () const |
Static Protected Member Functions | |
static Application::MouseButton | ConvertGLUTButton (int glutButton) |
static Application::MouseState | ConvertGLUTState (int state) |
static void | _initialize () |
static void | _display () |
glut display function to be registered with glutDisplayFunc | |
static void | _reshape (int width, int height) |
glut reshape function to be registered with glutReshapeFunc | |
static void | _motion (int x, int y) |
glut motion function to be registered with glutMotionFunc | |
static void | _mouse (int button, int state, int x, int y) |
glut mouse function to be registered with glutMouseFunc | |
static void | _keyboard (unsigned char ch, int x, int y) |
glut keyboard function to be registered with glutKeyboardFunc | |
static void | _keyboard_up (unsigned char ch, int x, int y) |
glut keyboard_up function to be registered with glutKeyboardUpFunc | |
Protected Attributes | |
int | mWindowID |
The window ID of the glut window for this app. | |
Static Protected Attributes | |
static ApplicationPtr | currentApp |
pointer to the currently running glutApp | |
static bool | initialized |
true iff _initialize() has been called |
green::glutApp::glutApp | ( | ) | [inline] |
default constructor, which will initialize glut if it isn't already. You do not need to call glutApp::_initialize() directly (indeed you can't, it is private).
int green::glutApp::CreateWindow | ( | std::string | name, | |
unsigned int | displayMode, | |||
int | width, | |||
int | height | |||
) |
create a new window for this glutApp and set it as the current window
name | is the title of the window | |
displayMode | is the glut display mode for the window (see man glutInitDisplayMode for a description of this parameter) | |
width | the width of the window | |
height | the height of the window |
void glutApp::RegisterGLUTCallbacks | ( | ) | [virtual] |
this function should always be overridden by the subclass each subclass should choose which callbacks to register
void green::glutApp::SetCurrent | ( | ApplicationPtr | app | ) | [inline] |
this function sets an Application as the current application
void green::glutApp::Init | ( | ) | [virtual] |
Initialize the glutApp
void green::glutApp::Run | ( | ) | [virtual] |
this is called to start the GLUT event loop
int green::glutApp::WindowWidth | ( | ) | const |
get the width of the current window
int green::glutApp::WindowHeight | ( | ) | const |
get the height of the current window
static Application::MouseButton green::glutApp::ConvertGLUTButton | ( | int | glutButton | ) | [inline, static, protected] |
Convert GLUT button to Application::MouseButton
glutButton | the button sent from GLUT |
static Application::MouseState green::glutApp::ConvertGLUTState | ( | int | state | ) | [inline, static, protected] |
convert GLUT mouse state to Application::MouseState
void green::glutApp::_initialize | ( | ) | [static, protected] |
this function is called once for all instances of glutApp to initialize glut