EPOC::Engine Class Reference

#include <Engine.h>

Inheritance diagram for EPOC::Engine:

Inheritance graph
[legend]
Collaboration diagram for EPOC::Engine:

Collaboration graph
[legend]

List of all members.

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 ()
TextureSDLGetSurface ()
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.
TextureSDLm_pScreen
 Screen surface.


Detailed Description

Engine core class. This class is the center of all EPOC applications

Constructor & Destructor Documentation

Engine::Engine (  ) 

Contructor Resets all members to the default values

Default constructor.

Engine::~Engine (  )  [virtual]

Destructor Calls the cleanup method.

See also:
Cleanup()
Destructor.


Member Function Documentation

void Engine::Cleanup (  )  [virtual]

Cleans up all relevant data

See also:
~Engine()

Reimplemented in EPOC::Application.

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

Parameters:
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
See also:
Initialize()

virtual bool EPOC::Engine::Initialize (  )  [pure virtual]

A pure virtual memeber Initializes the application for use

See also:
Start()
Returns:
true if the initiaization succeeded and false if it didn't

Implemented in EPOC::Application.

virtual bool EPOC::Engine::Update ( float  fTimeDelta  )  [pure virtual]

A pure virtual memeber updates the application

Remarks:
This function is called once per frame.
Parameters:
fTimeDelta the time that has passed since last update, measured in milliseconds
Returns:
true if the update succeeded and false if it didn't

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

Parameters:
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

Parameters:
sTitle the new title of the window

const std::string* EPOC::Engine::GetTitle (  )  [inline]

returns the title of the window

Returns:
pointer to the string containing the title of the window

TextureSDL* EPOC::Engine::GetSurface (  )  [inline]

returns the SDL surface at wich the content is rendered to

Returns:
pointer to the SDL surface used by the application

int EPOC::Engine::GetFPS (  )  [inline]

returns the last frames per second measurement

Returns:
float containing the last frames per second measurement

float EPOC::Engine::GetTimeDelta (  )  [inline]

returns the last time between updates

Returns:
float containing time delta

void EPOC::Engine::SetQuitKey ( int  nQuitKey = SDLK_ESCAPE  )  [inline]

sets which key to use as quit-key

Parameters:
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

Returns:
true if the update succeeded and false if it didn't
Remarks:
This function is called once per frame
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

Remarks:
This function is called once per frame
Handles all controller inputs.
Remarks:
This function is called once per frame.

bool Engine::SetVideoMode ( int  nWidth,
int  nHeight,
bool  bFullScreen = false,
int  nBpp = 0,
Uint32  nFlags = SDL_HWSURFACE 
) [protected, virtual]

sets the videomode to use

Parameters:
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
Returns:
true if the method succeeded and false if it didn't


Member Data Documentation

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.


The documentation for this class was generated from the following files:
Generated on Tue Feb 12 08:26:03 2008 for EPOC by  doxygen 1.5.4