#include <Engine.h>
Public Member Functions | |
Engine () | |
virtual | ~Engine () |
virtual void | Cleanup () |
virtual void | Start (std::string sTitle="SDL Application", int nWidth=800, int nHeight=600, bool bFullScreen=false, RENDER_MODE nRenderMode=kRENDER_MODE_SDL, int nCusomFlags=-1) |
virtual bool | Initialize ()=0 |
virtual bool | Update (float fTimeDelta)=0 |
virtual void | Render (TextureSDL *pDestSurface)=0 |
virtual void | NotifyWindowActive () |
virtual void | NotifyWindowInactive () |
void | SetTitle (std::string sTitle) |
const std::string * | GetTitle () |
TextureSDL * | GetSurface () |
int | GetFPS () |
float | GetTimeDelta () |
void | SetQuitKey (int nQuitKey=SDLK_ESCAPE) |
int | GetWindowWidth () |
int | GetWindowHeight () |
RENDER_MODE | GetRenderMode () |
const SDL_VideoInfo * | GetVideoInformation () |
bool | IsFPSCapEnabled () |
void | SetFPSCapEnabled (bool bStatus) |
unsigned int | GetFPSCap () |
void | SetFPSCap (int nFPSCap) |
Protected Member Functions | |
virtual bool | DoUpdate () |
virtual void | DoRender () |
virtual void | DoEvents () |
virtual bool | SetVideoMode (int nWidth, int nHeight, bool bFullScreen=false, int nBpp=0, Uint32 nFlags=SDL_HWSURFACE) |
Protected Attributes | |
RENDER_MODE | m_nRenderMode |
The render mode to be used, pure sdl or opengl. | |
bool | m_bFPSCapEnabled |
Is the framerate capped? | |
bool | m_bQuit |
Has quit been called? | |
bool | m_bMinimized |
Is the window minimized? | |
bool | m_bFullScreen |
Is the window in fullscreen? | |
bool | m_bMouseFocus |
bool | m_bKeyboardFocus |
bool | m_bAudioSupport |
unsigned int | m_nFPSCap |
The maximum framerate allowed. | |
int | m_nFlags |
Flags used when initializing. | |
int | m_nWidth |
Window width. | |
int | m_nHeight |
Window height. | |
int | m_nBpp |
Window bits per pixel. | |
int | m_nFPSTickCounter |
Tick counter. | |
int | m_nFPSCounter |
Frame rate counter. | |
int | m_nCurrentFPS |
Stores the last calculated frame rate. | |
int | m_nQuitKey |
The key enumeration that quits the program. | |
float | m_fTimeDelta |
long | m_lLastTick |
Last iteration's tick value. | |
std::string | m_sTitle |
The title of the window. | |
const SDL_VideoInfo * | m_pVideoInfo |
Information about the rendering capabilities. | |
TextureSDL * | m_pScreen |
Screen surface. |
Engine::Engine | ( | ) |
Contructor Resets all members to the default values
Default constructor.
Engine::~Engine | ( | ) | [virtual] |
Destructor Calls the cleanup method.
void Engine::Cleanup | ( | ) | [virtual] |
virtual void EPOC::Engine::Start | ( | std::string | sTitle = "SDL Application" , |
|
int | nWidth = 800 , |
|||
int | nHeight = 600 , |
|||
bool | bFullScreen = false , |
|||
RENDER_MODE | nRenderMode = kRENDER_MODE_SDL , |
|||
int | nCusomFlags = -1 | |||
) | [virtual] |
Fires up the application
sTitle | the title of the application window | |
nWidth | the width of the application window | |
nHeight | the height of the application window | |
bFullScreen | fullscreen window enabled or disabled |
virtual bool EPOC::Engine::Initialize | ( | ) | [pure virtual] |
A pure virtual memeber Initializes the application for use
Implemented in EPOC::Application.
virtual bool EPOC::Engine::Update | ( | float | fTimeDelta | ) | [pure virtual] |
A pure virtual memeber updates the application
fTimeDelta | the time that has passed since last update, measured in milliseconds |
Reimplemented from EPOC::BaseObject.
Implemented in EPOC::Application.
virtual void EPOC::Engine::Render | ( | TextureSDL * | pDestSurface | ) | [pure virtual] |
A pure virtual memeber Prepares and renders the application contents for presentation
pDestSurface | the surface to wich the content should be rendered to |
Implemented in EPOC::Application.
virtual void EPOC::Engine::NotifyWindowActive | ( | ) | [inline, virtual] |
Is called when window is activated
virtual void EPOC::Engine::NotifyWindowInactive | ( | ) | [inline, virtual] |
Is called when window is inactivated
void EPOC::Engine::SetTitle | ( | std::string | sTitle | ) |
Sets the title of the window
sTitle | the new title of the window |
const std::string* EPOC::Engine::GetTitle | ( | ) | [inline] |
returns the title of the window
TextureSDL* EPOC::Engine::GetSurface | ( | ) | [inline] |
returns the SDL surface at wich the content is rendered to
int EPOC::Engine::GetFPS | ( | ) | [inline] |
returns the last frames per second measurement
float EPOC::Engine::GetTimeDelta | ( | ) | [inline] |
returns the last time between updates
void EPOC::Engine::SetQuitKey | ( | int | nQuitKey = SDLK_ESCAPE |
) | [inline] |
sets which key to use as quit-key
nQuitKey | the SDLK enumeration key to use as quit-key |
int EPOC::Engine::GetWindowWidth | ( | ) | [inline] |
int EPOC::Engine::GetWindowHeight | ( | ) | [inline] |
RENDER_MODE EPOC::Engine::GetRenderMode | ( | ) | [inline] |
const SDL_VideoInfo* EPOC::Engine::GetVideoInformation | ( | ) | [inline] |
bool EPOC::Engine::IsFPSCapEnabled | ( | ) | [inline] |
void EPOC::Engine::SetFPSCapEnabled | ( | bool | bStatus | ) | [inline] |
unsigned int EPOC::Engine::GetFPSCap | ( | ) | [inline] |
void EPOC::Engine::SetFPSCap | ( | int | nFPSCap | ) | [inline] |
bool Engine::DoUpdate | ( | ) | [protected, virtual] |
handles the updating routine
void Engine::DoRender | ( | ) | [protected, virtual] |
handles the rendering and FPS calculations
Handles the rendering and FPS calculations.
void Engine::DoEvents | ( | ) | [protected, virtual] |
handles all core engine controller inputs
bool Engine::SetVideoMode | ( | int | nWidth, | |
int | nHeight, | |||
bool | bFullScreen = false , |
|||
int | nBpp = 0 , |
|||
Uint32 | nFlags = SDL_HWSURFACE | |||
) | [protected, virtual] |
sets the videomode to use
nWidth | the width of the renderwindow | |
nHeight | the height of the renderwindow | |
bFullScreen | if fullscreen should be used or not | |
nBpp | the bitdepth to use | |
nFlags | SDL flags for renderwindow |
RENDER_MODE EPOC::Engine::m_nRenderMode [protected] |
The render mode to be used, pure sdl or opengl.
bool EPOC::Engine::m_bFPSCapEnabled [protected] |
Is the framerate capped?
bool EPOC::Engine::m_bQuit [protected] |
Has quit been called?
bool EPOC::Engine::m_bMinimized [protected] |
Is the window minimized?
bool EPOC::Engine::m_bFullScreen [protected] |
Is the window in fullscreen?
bool EPOC::Engine::m_bMouseFocus [protected] |
bool EPOC::Engine::m_bKeyboardFocus [protected] |
bool EPOC::Engine::m_bAudioSupport [protected] |
unsigned int EPOC::Engine::m_nFPSCap [protected] |
The maximum framerate allowed.
int EPOC::Engine::m_nFlags [protected] |
Flags used when initializing.
int EPOC::Engine::m_nWidth [protected] |
Window width.
int EPOC::Engine::m_nHeight [protected] |
Window height.
int EPOC::Engine::m_nBpp [protected] |
Window bits per pixel.
int EPOC::Engine::m_nFPSTickCounter [protected] |
Tick counter.
int EPOC::Engine::m_nFPSCounter [protected] |
Frame rate counter.
int EPOC::Engine::m_nCurrentFPS [protected] |
Stores the last calculated frame rate.
int EPOC::Engine::m_nQuitKey [protected] |
The key enumeration that quits the program.
float EPOC::Engine::m_fTimeDelta [protected] |
long EPOC::Engine::m_lLastTick [protected] |
Last iteration's tick value.
std::string EPOC::Engine::m_sTitle [protected] |
The title of the window.
const SDL_VideoInfo* EPOC::Engine::m_pVideoInfo [protected] |
Information about the rendering capabilities.
TextureSDL* EPOC::Engine::m_pScreen [protected] |
Screen surface.