SDLInterface Class Reference

Specialisation of Interface for the Simple Direct Layer OS abstraction API. More...

#include <SDLInterface.h>

Inheritance diagram for SDLInterface:

Inheritance graph
[legend]
Collaboration diagram for SDLInterface:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ~SDLInterface ()
virtual int start ()
 Enter the main loop of the interface.
virtual void flush ()
 Make all drawings visible on-screen (i.e. flush any buffers).
virtual void repaint ()
 Mark the scene as needing repainting.
virtual void setIdleCallback (void(*func)(void))
 Set the idle callback function.
virtual void setPaintCallback (void(*func)(void))
 Set the paint callback function.
virtual void setKeyboardCallback (void(*func)(int key, int x, int y, bool special, bool down, unsigned int modifiers))
 Set the keyboard callback function.
virtual void setRawEventCallback (void(*func)(void *event))
 Set the raw event callback function.
virtual void addTimerCallback (void(*func)(int value), int time_ms, int val)
 Add a timer callback.
virtual void setWindowSize (int width, int height)
 Change the size of the current window.
virtual void setFullScreen (bool fullScreen)
 Set the fullscreen mode.
virtual bool getFullScreen (void)
 Check if the application is currently in fullscreen or windowed mode.
virtual void setMouseEventCallback (void(*func)(int x, int y, MouseButtonType button, bool down))
virtual void setMouseMotionCallback (void(*func)(int x, int y))
 Set the mouse motion callback function.
virtual int getTime ()
 Get a timestamp that is incremented with one every ms.
virtual int getWindowWidth ()
 Get width of current window.
virtual int getWindowHeight ()
 Get height of current window.
virtual const char * name ()
 Return the name of this interface type.

Protected Member Functions

virtual int init (int argc, const char *argv[], int width, int height)

Private Attributes

bool needsRepaint
bool full_screen

Detailed Description

Specialisation of Interface for the Simple Direct Layer OS abstraction API.


Constructor & Destructor Documentation

SDLInterface::~SDLInterface (  ) 


Member Function Documentation

virtual void SDLInterface::addTimerCallback ( void(*)(int value)  func,
int  time_ms,
int  val 
) [virtual]

Add a timer callback.

Parameters:
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.
Note:
The timer is not repeated.

Implements Interface.

virtual void SDLInterface::flush (  )  [virtual]

Make all drawings visible on-screen (i.e. flush any buffers).

Implements Interface.

virtual bool SDLInterface::getFullScreen ( void   )  [inline, virtual]

Check if the application is currently in fullscreen or windowed mode.

Returns:
true if application is in fullscreen mode, false if in windowed mode.

Implements Interface.

virtual int SDLInterface::getTime (  )  [virtual]

Get a timestamp that is incremented with one every ms.

The time at which getTime returns 0 is undefined.

Implements Interface.

virtual int SDLInterface::getWindowHeight (  )  [virtual]

Get height of current window.

Implements Interface.

virtual int SDLInterface::getWindowWidth (  )  [virtual]

Get width of current window.

Implements Interface.

virtual int SDLInterface::init ( int  argc,
const char *  argv[],
int  width,
int  height 
) [protected, virtual]

Implements Interface.

virtual const char* SDLInterface::name (  )  [inline, virtual]

Return the name of this interface type.

Reimplemented from Interface.

virtual void SDLInterface::repaint (  )  [virtual]

Mark the scene as needing repainting.

Implements Interface.

virtual void SDLInterface::setFullScreen ( bool  fullScreen  )  [virtual]

Set the fullscreen mode.

Parameters:
fullScreen If true switch to full screen mode, if false switch to window mode.

Implements Interface.

virtual void SDLInterface::setIdleCallback ( void(*)(void)  func  )  [virtual]

Set the idle callback function.

Parameters:
func a function to call when no other events are pending, NULL for none.

Implements Interface.

virtual void SDLInterface::setKeyboardCallback ( void(*)(int key, int x, int y, bool special, bool down, unsigned int modifiers)  func  )  [virtual]

Set the keyboard callback function.

Parameters:
func a function to call when a keyboard event is detected, NULL for none.

Implements Interface.

virtual void SDLInterface::setMouseEventCallback ( void(*)(int x, int y, MouseButtonType button, bool down)  func  )  [virtual]

virtual void SDLInterface::setMouseMotionCallback ( void(*)(int x, int y)  func  )  [virtual]

Set the mouse motion callback function.

Parameters:
func a function to call when mouse moves, NULL for none.

Implements Interface.

virtual void SDLInterface::setPaintCallback ( void(*)(void)  func  )  [virtual]

Set the paint callback function.

Parameters:
func a function to call to draw the scene, NULL for none.

Implements Interface.

virtual void SDLInterface::setRawEventCallback ( void(*)(void *event)  func  )  [virtual]

Set the raw event callback function.

Parameters:
func a function to call for each new event, NULL for none.

Implements Interface.

virtual void SDLInterface::setWindowSize ( int  width,
int  height 
) [virtual]

Change the size of the current window.

Implements Interface.

virtual int SDLInterface::start (  )  [virtual]

Enter the main loop of the interface.

Implements Interface.


Member Data Documentation

bool SDLInterface::full_screen [private]

bool SDLInterface::needsRepaint [private]


The documentation for this class was generated from the following file:
Generated on Sun Mar 11 15:33:26 2007 for MetalWarriors by  doxygen 1.4.7