Neo  0.5.0
Developer Documentation
Neo::SystemContext Class Referenceabstract

This class implements a basic interface to the underlying operating system. More...

#include <SystemContext.h>

Public Member Functions

virtual ~SystemContext (void)
 
virtual void getScreenSize (unsigned int *width, unsigned int *height)=0
 Fetches the current screen resolution or window size in pixels. More...
 
virtual Vector2 getScreenSize ()=0
 Returns the current screen resolution or window size in pixels. More...
 
virtual void setCursorPosition (int x, int y)
 Changes the current cursor position. More...
 
virtual void hideCursor (void)
 Hides the cursor. More...
 
virtual void showCursor (void)
 Shows the cursor. More...
 
virtual const char * getWorkingDirectory (void)=0
 Returns the working directory as a C string. More...
 
virtual unsigned long getSystemTick (void)=0
 Returns the current system time in millis. More...
 
virtual void setWindowTitle (const char *title)=0
 Changes the window title of the game window. More...
 
virtual void setScreenSize (unsigned int width, unsigned int height)=0
 Changes the screen resolution or the window size depending on if the window is fullscreen. More...
 

Detailed Description

This class implements a basic interface to the underlying operating system.

It provides functionality to accomplish environment dependant functionality like changing the screen resolution (or window size), show and hide the mouse cursor and similar.

This class usually only has one instance that can be fetched from NeoEngine with NeoEngine::getSystemContext().

Constructor & Destructor Documentation

virtual Neo::SystemContext::~SystemContext ( void  )
inlinevirtual

Member Function Documentation

virtual void Neo::SystemContext::getScreenSize ( unsigned int *  width,
unsigned int *  height 
)
pure virtual

Fetches the current screen resolution or window size in pixels.

Needs to be used like this:

unsigned int w, h;
system->getScreenSize(&w, &h);
Parameters
widthA pointer to an unsigned integer variable.
heightA pointer to an unsigned integer variable.
virtual Vector2 Neo::SystemContext::getScreenSize ( )
pure virtual

Returns the current screen resolution or window size in pixels.

Returns
A Vector2 with the current window size.
virtual unsigned long Neo::SystemContext::getSystemTick ( void  )
pure virtual

Returns the current system time in millis.

Returns
The current system tick.
virtual const char* Neo::SystemContext::getWorkingDirectory ( void  )
pure virtual

Returns the working directory as a C string.

Returns
The working directory path.
virtual void Neo::SystemContext::hideCursor ( void  )
inlinevirtual

Hides the cursor.

virtual void Neo::SystemContext::setCursorPosition ( int  x,
int  y 
)
inlinevirtual

Changes the current cursor position.

Parameters
xX-Coordinate in pixels
yY-Coordinate in pixels
virtual void Neo::SystemContext::setScreenSize ( unsigned int  width,
unsigned int  height 
)
pure virtual

Changes the screen resolution or the window size depending on if the window is fullscreen.

Parameters
widthThe new width in pixels.
heightThe new height in pixels.
virtual void Neo::SystemContext::setWindowTitle ( const char *  title)
pure virtual

Changes the window title of the game window.

Parameters
titleThe new title that shall be used.
virtual void Neo::SystemContext::showCursor ( void  )
inlinevirtual

Shows the cursor.


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