#include "GameUtils.h"
Functions | |
bool | InitD3D (HWND hWnd, LPDIRECT3DDEVICE9 *ppd3dDevice, LPDIRECT3D9 *ppD3D, D3DPRESENT_PARAMETERS **ppd3dpp, 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 **ppDS) |
This function creates DirectX sound device. | |
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. | |
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.
hWnd | handle to application window |
bool InitD3D | ( | HWND | hWnd, | |
LPDIRECT3DDEVICE9 * | ppd3dDevice, | |||
LPDIRECT3D9 * | ppD3D, | |||
D3DPRESENT_PARAMETERS ** | ppd3dpp, | |||
bool | fullscreen | |||
) |
This function creates DirectX 3D Device.
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 |
bool InitLight | ( | LPDIRECT3DDEVICE9 | pd3dDevice, | |
D3DLIGHT9 * | light1, | |||
D3DLIGHT9 * | light2, | |||
D3DLIGHT9 * | light3 | |||
) |
This function creates lights.
light1 | pointer to light to be created |
bool InitSound | ( | HWND | hWnd, | |
IDirectSound8 ** | ppDS | |||
) |
This function creates DirectX sound device.
ppDS | sound device to be created |
void Reset3D | ( | LPDIRECT3DDEVICE9 | pd3dDevice, | |
D3DPRESENT_PARAMETERS * | pPP | |||
) |
This function resets D3D device.
pPP | new presentation parameters |
void SetupMatrices | ( | LPDIRECT3DDEVICE9 * | ppd3dDevice, | |
D3DXVECTOR3 * | eye, | |||
D3DXVECTOR3 * | lookAt, | |||
D3DXVECTOR3 * | upVec, | |||
float | aspectRatio | |||
) |
World, View and Projection matrices are set with passed function parameters.
eye | position of the camera | |
lookAt | position where camera is pointed to. |
void ToggleFullScreen | ( | HWND | hWnd, | |
LPDIRECT3DDEVICE9 | pd3dDevice, | |||
D3DPRESENT_PARAMETERS ** | ppPP, | |||
LPDIRECT3D9 | pD3D, | |||
int * | oldScreenWidth, | |||
int * | oldScreenHeight, | |||
int * | screenWidth, | |||
int * | screenHeight | |||
) |
Toggles fullscreen/windowed mode.
oldScreenWidth | screen width of previous application window state |