Osiris Framework  0.1
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...
 
void start ()
 Initializes the application and starts the main loop.
 

Protected Member Functions

virtual void init ()=0
 
virtual void clearScreen ()
 Called in the begining of the render process for each loop to clear the previous screen.
 
virtual void update (int timeIndex_ms)=0
 
virtual void onKeyboardPress (unsigned char key, int mouse_x, int mouse_y)
 Virtual method to process key strokes. More...
 
void onWindowResize (int width, int height)
 Virtual method called when the window is resized. More...
 

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

OCamera * OApplication::camera ( )

Returns the application camera object.

Returns
Pointer to the application camera object.
void OApplication::onKeyboardPress ( unsigned char  key,
int  mouse_x,
int  mouse_y 
)
protectedvirtual

Virtual method to process key strokes.

Parameters
keyASCII key code.
mouse_xPosition in the X axis of the mouse pointer.
mouse_yPosition in the Y axis of the mouse pointer.
void OApplication::onWindowResize ( int  width,
int  height 
)
protected

Virtual method called when the window is resized.

Camera and screen adjustments are already dealt by OApplication.

Parameters
widthNew window width.
heightNew window height.

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