My Documents/TS2/inc/GameUtils.h File Reference

Header file for utility functions in GameUtils.cpp. More...

#include <Windows.h>
#include "d3dx9.h"
#include <dsound.h>
#include <vector>

Include dependency graph for GameUtils.h:

This graph shows which files directly or indirectly include this file:


Namespaces

namespace  std

Enumerations

enum  GAME_MODES_ENUM

Functions

bool InitD3D (HWND hWnd, LPDIRECT3DDEVICE9 *pd3dDevice, LPDIRECT3D9 *pD3D, D3DPRESENT_PARAMETERS **ppPP, bool fullscreen)
 This function creates DirectX 3D Device.
bool InitLight (LPDIRECT3DDEVICE9 pd3dDevice, D3DLIGHT9 *light1, D3DLIGHT9 *light2, D3DLIGHT9 *light3)
 This function creates lights.
bool InitSound (HWND hWnd, IDirectSound8 **m_pDS)
 This function creates DirectX sound device.
void SetupMatrices (LPDIRECT3DDEVICE9 *ppd3dDevice, D3DXVECTOR3 *eye, D3DXVECTOR3 *lookAt, D3DXVECTOR3 *upVec, float aspectRatio)
 World, View and Projection matrices are set with passed function parameters.
void CaptureWindowParameters (HWND hWnd)
 Captures current window parameters, to restore them later.
void ToggleFullScreen (HWND hWnd, LPDIRECT3DDEVICE9 pd3dDevice, D3DPRESENT_PARAMETERS **ppPP, LPDIRECT3D9 pD3D, int *oldScreenWidth, int *oldScreenHeight, int *screenWidth, int *screenHeight)
 Toggles fullscreen/windowed mode.
void Reset3D (LPDIRECT3DDEVICE9 pd3dDevice, D3DPRESENT_PARAMETERS *pPP)
 This function resets D3D device.

Detailed Description

Header file for utility functions in GameUtils.cpp.

Author:
Petar Bajic, MPE (C) All Rights Reserved, Homepage: www.mystic-peanut.com
Date:
January, 16 2007.

Enumeration Type Documentation

enum GAME_MODES_ENUM

Game modes enum. Defines several game modes assigned to m_GameMode member variable of CGame.


Function Documentation

void CaptureWindowParameters ( HWND  hWnd  ) 

Captures current window parameters, to restore them later.

Parameters:
hWnd handle to application window
Author:
Petar Bajic
Date:
January, 16 2007.

bool InitD3D ( HWND  hWnd,
LPDIRECT3DDEVICE9 *  ppd3dDevice,
LPDIRECT3D9 *  ppD3D,
D3DPRESENT_PARAMETERS **  ppd3dpp,
bool  fullscreen 
)

This function creates DirectX 3D Device.

Parameters:
hWnd handle to the application window
ppd3dDevice pointer to d3d device to be created
ppd3dpp directX presentation parameters
fullscreen boolean telling if application is started in fullscreen or windowed mode
Author:
Petar Bajic
Date:
January, 16 2007.

bool InitLight ( LPDIRECT3DDEVICE9  pd3dDevice,
D3DLIGHT9 *  light1,
D3DLIGHT9 *  light2,
D3DLIGHT9 *  light3 
)

This function creates lights.

Parameters:
light1 pointer to light to be created
Author:
Petar Bajic
Date:
January, 16 2007.

bool InitSound ( HWND  hWnd,
IDirectSound8 **  ppDS 
)

This function creates DirectX sound device.

Parameters:
ppDS sound device to be created
Author:
Petar Bajic
Date:
January, 16 2007.

void Reset3D ( LPDIRECT3DDEVICE9  pd3dDevice,
D3DPRESENT_PARAMETERS *  pPP 
)

This function resets D3D device.

Parameters:
pPP new presentation parameters
Author:
Petar Bajic
Date:
January, 16 2007.

void SetupMatrices ( LPDIRECT3DDEVICE9 *  ppd3dDevice,
D3DXVECTOR3 *  eye,
D3DXVECTOR3 *  lookAt,
D3DXVECTOR3 *  upVec,
float  aspectRatio 
)

World, View and Projection matrices are set with passed function parameters.

Parameters:
eye position of the camera
lookAt position where camera is pointed to.
Author:
Petar Bajic
Date:
January, 16 2007.

void ToggleFullScreen ( HWND  hWnd,
LPDIRECT3DDEVICE9  pd3dDevice,
D3DPRESENT_PARAMETERS **  ppPP,
LPDIRECT3D9  pD3D,
int *  oldScreenWidth,
int *  oldScreenHeight,
int *  screenWidth,
int *  screenHeight 
)

Toggles fullscreen/windowed mode.

Parameters:
oldScreenWidth screen width of previous application window state
Author:
Petar Bajic
Date:
January, 16 2007.


Generated on Wed Mar 26 16:00:53 2008 for Turtle Shepherd by  doxygen 1.5.3