#include <Interface.h>
Inheritance diagram for Interface:


Public Types | |
| LEFT_BUTTON = 1 | |
| MIDDLE_BUTTON = 1 << 1 | |
| RIGHT_BUTTON = 1 << 2 | |
| FOURTH_BUTTON = 1 << 3 | |
| FIFTH_BUTTON = 1 << 4 | |
| enum | MouseButtonType { LEFT_BUTTON = 1, MIDDLE_BUTTON = 1 << 1, RIGHT_BUTTON = 1 << 2, FOURTH_BUTTON = 1 << 3, FIFTH_BUTTON = 1 << 4 } |
| Mouse buttons that can be detected. More... | |
Public Member Functions | |
| virtual | ~Interface () |
| Empty destructor. | |
| virtual int | start ()=0 |
| Enter the main loop of the interface. | |
| virtual void | flush ()=0 |
| Make all drawings visible on-screen (i.e. flush any buffers). | |
| virtual void | repaint ()=0 |
| Mark the scene as needing repainting. | |
| virtual void | setIdleCallback (void(*func)(void))=0 |
| Set the idle callback function. | |
| virtual void | setPaintCallback (void(*func)(void))=0 |
| Set the paint callback function. | |
| virtual void | setKeyboardCallback (void(*func)(int key, int x, int y, bool special, bool down, unsigned int modifiers))=0 |
| Set the keyboard callback function. | |
| virtual void | addTimerCallback (void(*func)(int value), int time_ms, int val=0)=0 |
| Add a timer callback. | |
| virtual void | setMouseEventCallback (void(*func)(int x, int y, MouseButtonType button, bool down))=0 |
| Set the mouse clicked callback function. | |
| virtual void | setMouseMotionCallback (void(*func)(int x, int y))=0 |
| Set the mouse motion callback function. | |
| virtual void | setRawEventCallback (void(*func)(void *event))=0 |
| Set the raw event callback function. | |
| virtual void | setWindowSize (int width, int height)=0 |
| Change the size of the current window. | |
| virtual void | setFullScreen (bool fullScreen)=0 |
| Set the fullscreen mode. | |
| virtual bool | getFullScreen (void)=0 |
| Check if the application is currently in fullscreen or windowed mode. | |
| virtual int | getTime ()=0 |
| Get a timestamp that is incremented with one every ms. | |
| virtual int | getWindowWidth ()=0 |
| Get width of current window. | |
| virtual int | getWindowHeight ()=0 |
| Get height of current window. | |
| virtual const char * | name () |
| Return the name of this interface type. | |
Static Public Member Functions | |
| static Interface * | GetSharedInstance () |
| Return a pointer to the singleton object representing the applications interface. | |
| static int | Init (Interface *iface, int argc, const char *argv[], int width, int height) |
| Initialize the singleton object with a specific instance of an Interface. | |
| static void | Exit () |
| Clean up the singleton object. | |
Protected Member Functions | |
| virtual int | init (int argc, const char *argv[], int width, int height)=0 |
Static Private Attributes | |
| static Interface * | sharedInstance |
| virtual Interface::~Interface | ( | ) | [inline, virtual] |
Empty destructor.
| virtual void Interface::addTimerCallback | ( | void(*)(int value) | func, | |
| int | time_ms, | |||
| int | val = 0 | |||
| ) | [pure virtual] |
Add a timer callback.
| func | a function to call when the timer expires, NULL for none. | |
| time_ms | The time in ms until the timer fires. | |
| val | An optional value to pass to the timer function. |
Implemented in GLUTInterface, and SDLInterface.
| static void Interface::Exit | ( | ) | [static] |
Clean up the singleton object.
| virtual void Interface::flush | ( | ) | [pure virtual] |
Make all drawings visible on-screen (i.e. flush any buffers).
Implemented in GLUTInterface, and SDLInterface.
| virtual bool Interface::getFullScreen | ( | void | ) | [pure virtual] |
Check if the application is currently in fullscreen or windowed mode.
Implemented in SDLInterface.
| static Interface* Interface::GetSharedInstance | ( | ) | [inline, static] |
Return a pointer to the singleton object representing the applications interface.
| virtual int Interface::getTime | ( | ) | [pure virtual] |
Get a timestamp that is incremented with one every ms.
The time at which getTime returns 0 is undefined.
Implemented in GLUTInterface, and SDLInterface.
| virtual int Interface::getWindowHeight | ( | ) | [pure virtual] |
| virtual int Interface::getWindowWidth | ( | ) | [pure virtual] |
| virtual int Interface::init | ( | int | argc, | |
| const char * | argv[], | |||
| int | width, | |||
| int | height | |||
| ) | [protected, pure virtual] |
Implemented in GLUTInterface, and SDLInterface.
| static int Interface::Init | ( | Interface * | iface, | |
| int | argc, | |||
| const char * | argv[], | |||
| int | width, | |||
| int | height | |||
| ) | [static] |
Initialize the singleton object with a specific instance of an Interface.
| iface | A specific instance of an Interface. | |
| argc | number of strings in argv | |
| argv | interesting argument strings for the interface initialization | |
| width | Create a default window with this width | |
| height | Create a default window with this height |
| virtual const char* Interface::name | ( | ) | [inline, virtual] |
| virtual void Interface::repaint | ( | ) | [pure virtual] |
| virtual void Interface::setFullScreen | ( | bool | fullScreen | ) | [pure virtual] |
Set the fullscreen mode.
| fullScreen | If true switch to full screen mode, if false switch to window mode. |
Implemented in GLUTInterface, and SDLInterface.
| virtual void Interface::setIdleCallback | ( | void(*)(void) | func | ) | [pure virtual] |
Set the idle callback function.
| func | a function to call when no other events are pending, NULL for none. |
Implemented in GLUTInterface, and SDLInterface.
| virtual void Interface::setKeyboardCallback | ( | void(*)(int key, int x, int y, bool special, bool down, unsigned int modifiers) | func | ) | [pure virtual] |
Set the keyboard callback function.
| func | a function to call when a keyboard event is detected, NULL for none. |
Implemented in SDLInterface.
| virtual void Interface::setMouseEventCallback | ( | void(*)(int x, int y, MouseButtonType button, bool down) | func | ) | [pure virtual] |
Set the mouse clicked callback function.
| func | a function to call when any mouse button is clicked, NULL for none. |
| virtual void Interface::setMouseMotionCallback | ( | void(*)(int x, int y) | func | ) | [pure virtual] |
Set the mouse motion callback function.
| func | a function to call when mouse moves, NULL for none. |
Implemented in GLUTInterface, and SDLInterface.
| virtual void Interface::setPaintCallback | ( | void(*)(void) | func | ) | [pure virtual] |
Set the paint callback function.
| func | a function to call to draw the scene, NULL for none. |
Implemented in GLUTInterface, and SDLInterface.
| virtual void Interface::setRawEventCallback | ( | void(*)(void *event) | func | ) | [pure virtual] |
Set the raw event callback function.
| func | a function to call for each new event, NULL for none. |
Implemented in SDLInterface.
| virtual void Interface::setWindowSize | ( | int | width, | |
| int | height | |||
| ) | [pure virtual] |
| virtual int Interface::start | ( | ) | [pure virtual] |
Interface* Interface::sharedInstance [static, private] |
1.4.7