My Project
SallyAPI::Core::CGame Class Reference

Game. More...

#include <Game.h>

List of all members.

Public Member Functions

 CGame ()
 Default constructor.
virtual ~CGame ()
 Destructor.
void GameLoop ()
 The Main Loop to Peek the Messages and Execute the Game.
bool Initialise (HWND hWnd, HINSTANCE hInst)
 Init the Game Engine and calls then the InitialiseEx.

Static Public Member Functions

static LPDIRECT3DDEVICE9 GetDevice ()
 Gets the direct3d device.
static LPDIRECT3D9 GetD3D ()
 Gets the Direct3d.
static SallyAPI::Core::CCameraGetCamera ()
 Gets the camera.
static SallyAPI::Core::CCounterGetCounter ()
 Gets the counter instance.
static LPD3DXSPRITE GetSpriteInterface ()
 Gets the sprite interface.
static SallyAPI::System::CLoggerGetLogger ()
 Gets the logger.
static HWND GetHWnd ()
 Gets the HWND of the window.
static HINSTANCE GetHInstance ()
 Gets the HInstance of the window.
static int GetScreenWidth ()
 Gets the screen width.
static int GetScreenHeight ()
 Gets the screen height.
static std::string GetMediaFolder ()
 Gets the media folder.
static void SetMediaFolder (const std::string &mediaFolder)
 Sets a media folder.
static void IncreaseDrawCount ()
 Increase draw count.
static bool StartRenderToTexture (LPDIRECT3DTEXTURE9 pRenderTexture)
static bool EndRenderToTexture ()

Protected Member Functions

bool InitialiseLights ()
 Initialises the lights.
bool InitialiseDirect3D ()
 Initialises the direct 3 d.
bool InitialiseDeviceStates ()
 Initialises the device states.
bool CheckDevice ()
 check for lost device.
void CheckDisplayMode ()
 Check display mode.
bool InitialisePresentationParameters ()
 Initialises the presentation parameters.
bool InitialiseDisplayMode ()
 Initialises the display mode.
bool OnLostDevice ()
 Executes the lost device action.
bool OnRestoreDevice ()
 Executes the restore device action.
void Render ()
 The core Render Methods (calculates the FPS).
void ExecuteGame ()
 Executes the Game Actions and calls the Render Method.
virtual bool InitialiseEx ()
 Initialises the ex.
virtual void ExecuteGameEx ()
 Executes the game ex operation.
virtual void OnCommandDeviceRestoreStart ()=0
virtual void OnCommandDeviceRestoreEnd ()=0
virtual void OnCommandDeviceLost ()=0
virtual void TimerEvent ()=0
virtual void RenderEx ()=0

Protected Attributes

int m_iDeviceId
int m_iVertexProcessing
bool m_bWindowd
bool m_bMultiMonitor
std::string m_strMonitorId
int m_iWindowPosX
int m_iWindowPosY
int m_iWindowWidth
int m_iWindowHeight
float m_fWidthCorrection
float m_fHeightCorrection
int m_iScreenColorDepth
DEVICE_STATE m_eDeviceState
D3DMULTISAMPLE_TYPE m_MultiSampleType
D3DDISPLAYMODE m_DisplayMode
D3DPRESENT_PARAMETERS m_PresentParameters
LPDIRECTINPUT8 m_pDirectInput
LPDIRECTINPUTDEVICE8 m_pKeyboard
LPDIRECTINPUTDEVICE8 m_pMouse
LPDIRECTINPUTDEVICE8 m_pGamepad
DWORD m_dwFrames
DWORD m_dwFramesPerSecond
DWORD m_dwFramesPerSecondNew
DWORD m_dwLastFramesPerSecondTime
int m_iQuit

Static Protected Attributes

static int m_iScreenWidth
static int m_iScreenHeight
static std::string m_strMediaFolder
static SallyAPI::System::CLoggerm_pLogger = NULL
static SallyAPI::Core::CCameram_pCamera = NULL
static SallyAPI::Core::CCounterm_pCounter = NULL
static LPDIRECT3DDEVICE9 m_pDirect3DDevice = NULL
static LPD3DXSPRITE m_pSpriteInterface = NULL
static LPDIRECT3D9 m_pDirect3D = NULL
static LPDIRECT3DSURFACE9 m_pBackBuffer = NULL
static LPDIRECT3DSURFACE9 m_pRenderTarget = NULL
static HWND m_hWnd = NULL
static HINSTANCE m_hInst = NULL
static int m_iDrawCount = 0
static int m_iDrawCountNew = 0

Detailed Description

Game.

Author:
Christian Knobloch
Date:
19.04.2010

Constructor & Destructor Documentation

Default constructor.

Author:
Christian Knobloch
Date:
19.04.2010
CGame::~CGame ( ) [virtual]

Destructor.

Author:
Christian Knobloch
Date:
19.04.2010

Member Function Documentation

bool CGame::CheckDevice ( ) [protected]

check for lost device.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
true if it succeeds, false if it fails.
void CGame::CheckDisplayMode ( ) [protected]

Check display mode.

Author:
Christian Knobloch
Date:
19.04.2010
bool CGame::EndRenderToTexture ( ) [static]
void CGame::ExecuteGame ( ) [protected]

Executes the Game Actions and calls the Render Method.

Author:
Christian Knobloch
Date:
19.04.2010
void CGame::ExecuteGameEx ( ) [protected, virtual]

Executes the game ex operation.

Author:
Christian Knobloch
Date:
19.04.2010
void CGame::GameLoop ( )

The Main Loop to Peek the Messages and Execute the Game.

Author:
Christian Knobloch
Date:
19.04.2010

Gets the camera.

Author:
Christian Knobloch
Date:
18.02.2011
Returns:
null if it fails, else the camera.

Gets the counter instance.

Author:
Christian Knobloch
Date:
18.02.2011
Returns:
null if it fails, else the counter instance.
LPDIRECT3D9 CGame::GetD3D ( ) [static]

Gets the Direct3d.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
The d 3 d.
LPDIRECT3DDEVICE9 CGame::GetDevice ( ) [static]

Gets the direct3d device.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
The device.
HINSTANCE CGame::GetHInstance ( ) [static]

Gets the HInstance of the window.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
The h instance.
HWND CGame::GetHWnd ( ) [static]

Gets the HWND of the window.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
The h window.

Gets the logger.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
null if it fails, else the logger.
std::string CGame::GetMediaFolder ( ) [static]

Gets the media folder.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
The media folder.
int CGame::GetScreenHeight ( ) [static]

Gets the screen height.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
The screen height.
int CGame::GetScreenWidth ( ) [static]

Gets the screen width.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
The screen width.
LPD3DXSPRITE CGame::GetSpriteInterface ( ) [static]

Gets the sprite interface.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
The sprite interface.
void CGame::IncreaseDrawCount ( ) [static]

Increase draw count.

Author:
Christian Knobloch
Date:
19.04.2010
bool CGame::Initialise ( HWND  hWnd,
HINSTANCE  hInst 
)

Init the Game Engine and calls then the InitialiseEx.

Author:
Christian Knobloch
Date:
19.04.2010
Parameters:
hWndHandle of the window.
hInstThe instance.
Returns:
true if it succeeds, false if it fails.
bool CGame::InitialiseDeviceStates ( ) [protected]

Initialises the device states.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
true if it succeeds, false if it fails.
bool CGame::InitialiseDirect3D ( ) [protected]

Initialises the direct 3 d.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
true if it succeeds, false if it fails.
bool CGame::InitialiseDisplayMode ( ) [protected]

Initialises the display mode.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
true if it succeeds, false if it fails.
bool CGame::InitialiseEx ( ) [protected, virtual]

Initialises the ex.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
true if it succeeds, false if it fails.
bool CGame::InitialiseLights ( ) [protected]

Initialises the lights.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
true if it succeeds, false if it fails.

Initialises the presentation parameters.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
true if it succeeds, false if it fails.
virtual void SallyAPI::Core::CGame::OnCommandDeviceLost ( ) [protected, pure virtual]
virtual void SallyAPI::Core::CGame::OnCommandDeviceRestoreEnd ( ) [protected, pure virtual]
virtual void SallyAPI::Core::CGame::OnCommandDeviceRestoreStart ( ) [protected, pure virtual]
bool CGame::OnLostDevice ( ) [protected]

Executes the lost device action.

Author:
Christian Knobloch
Date:
01.06.2010
Returns:
true if it succeeds, false if it fails.
bool CGame::OnRestoreDevice ( ) [protected]

Executes the restore device action.

Author:
Christian Knobloch
Date:
01.06.2010
Returns:
true if it succeeds, false if it fails.
void CGame::Render ( ) [protected]

The core Render Methods (calculates the FPS).

Author:
Christian Knobloch
Date:
19.04.2010
virtual void SallyAPI::Core::CGame::RenderEx ( ) [protected, pure virtual]
void CGame::SetMediaFolder ( const std::string &  mediaFolder) [static]

Sets a media folder.

Author:
Christian Knobloch
Date:
19.04.2010
Parameters:
mediaFolderPathname of the media folder.
bool CGame::StartRenderToTexture ( LPDIRECT3DTEXTURE9  pRenderTexture) [static]
virtual void SallyAPI::Core::CGame::TimerEvent ( ) [protected, pure virtual]

Member Data Documentation

D3DDISPLAYMODE SallyAPI::Core::CGame::m_DisplayMode [protected]
HINSTANCE CGame::m_hInst = NULL [static, protected]
HWND CGame::m_hWnd = NULL [static, protected]
int CGame::m_iDrawCount = 0 [static, protected]
int CGame::m_iDrawCountNew = 0 [static, protected]
int CGame::m_iScreenHeight [static, protected]
int CGame::m_iScreenWidth [static, protected]
D3DMULTISAMPLE_TYPE SallyAPI::Core::CGame::m_MultiSampleType [protected]
LPDIRECT3DSURFACE9 CGame::m_pBackBuffer = NULL [static, protected]
SallyAPI::Core::CCamera * CGame::m_pCamera = NULL [static, protected]
SallyAPI::Core::CCounter * CGame::m_pCounter = NULL [static, protected]
LPDIRECT3D9 CGame::m_pDirect3D = NULL [static, protected]
LPDIRECT3DDEVICE9 CGame::m_pDirect3DDevice = NULL [static, protected]
LPDIRECTINPUT8 SallyAPI::Core::CGame::m_pDirectInput [protected]
LPDIRECTINPUTDEVICE8 SallyAPI::Core::CGame::m_pGamepad [protected]
LPDIRECTINPUTDEVICE8 SallyAPI::Core::CGame::m_pKeyboard [protected]
SallyAPI::System::CLogger * CGame::m_pLogger = NULL [static, protected]
LPDIRECTINPUTDEVICE8 SallyAPI::Core::CGame::m_pMouse [protected]
LPDIRECT3DSURFACE9 CGame::m_pRenderTarget = NULL [static, protected]
D3DPRESENT_PARAMETERS SallyAPI::Core::CGame::m_PresentParameters [protected]
LPD3DXSPRITE CGame::m_pSpriteInterface = NULL [static, protected]
std::string CGame::m_strMediaFolder [static, protected]
std::string SallyAPI::Core::CGame::m_strMonitorId [protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines