Osiris Framework  0.2
OApplication Class Referenceabstract

The Osiris Application base class. More...

#include <OsirisSDK/OApplication.h>

Public Member Functions

 OApplication (const char *title, int argc, char **argv, int windowPos_x=OAPPLICATION_DEFAULT_POSX, int windowPos_y=OAPPLICATION_DEFAULT_POSY, int windowWidth=OAPPLICATION_DEFAULT_WIDTH, int windowHeight=OAPPLICATION_DEFAULT_HEIGHT)
 Class constructor. More...
 
virtual ~OApplication ()
 Class destructor.
 
OCameracamera ()
 Returns the application camera object. More...
 
int windowWidth () const
 Returns the window width in pixels.
 
int windowHeight () const
 Returns the window height in pixels.
 
void addEventRecipient (OEvent::EventType eventType, OObject *recipient)
 Adds an OObject class object as event recipient for given type. More...
 
void removeEventRecipient (OEvent::EventType eventType, OObject *recipient)
 Removes an OObject class object as event recipient for given type. More...
 
void start ()
 Initializes the application and starts the main loop.
 
void scheduleDelete (OObject *obj)
 Schedule an object for deletion at the end of the current loop.
 

Static Public Member Functions

static OApplicationactiveInstance ()
 Returns active OApplication instance.
 

Protected Member Functions

virtual void init ()=0
 Method called prior to entering the main loop to initialize the OApplication object.
 
virtual void clearScreen ()
 Called in the begining of the render process for each loop to clear the previous screen.
 
void queueEvent (OEvent *evt)
 Queue event to be processed by the application and the subscribed OOBject class objects.
 
void processEvents ()
 Process event queue.
 
void deleteObjects ()
 Remove objects previously scheduled for deletion.
 
virtual void update (int timeIndex_ms)=0
 Method called on each simulation iteration.
 

Detailed Description

The Osiris Application base class.

This is the class that represents an application based on the Osiris Framework. It handles basic interaction with OpenGL, creating the window and handling main loop.

Constructor & Destructor Documentation

OApplication::OApplication ( const char *  title,
int  argc,
char **  argv,
int  windowPos_x = OAPPLICATION_DEFAULT_POSX,
int  windowPos_y = OAPPLICATION_DEFAULT_POSY,
int  windowWidth = OAPPLICATION_DEFAULT_WIDTH,
int  windowHeight = OAPPLICATION_DEFAULT_HEIGHT 
)

Class constructor.

The constructor creates the window and initializes OpenGL.

Parameters
titleApplication window title.
argcNumber of command line arguments
argvCommand line arguments.
windowPos_xWindow position on the X axis.
windowPos_yWindow position on the Y axis.
windowWidthWindow width.
windowHeightWindow height.

Member Function Documentation

void OApplication::addEventRecipient ( OEvent::EventType  eventType,
OObject recipient 
)

Adds an OObject class object as event recipient for given type.

Parameters
eventTypeEvent type.
recipientObject that will receive the events.
OCamera * OApplication::camera ( )

Returns the application camera object.

Returns
Pointer to the application camera object.
void OApplication::removeEventRecipient ( OEvent::EventType  eventType,
OObject recipient 
)

Removes an OObject class object as event recipient for given type.

Parameters
eventTypeEvent type.
recipientObject that will receive the events.

The documentation for this class was generated from the following files: