![]() |
Engine
The Game Engine for Ian Parberry's "Introduction to Game Physics with Box2D"
|
Main file for Ian Parberry's game engine. More...
#include <windows.h>#include <windowsx.h>#include <process.h>#include "defines.h"#include "abort.h"#include "tinyxml.h"#include "debug.h"#include "timer.h"#include "sprite.h"#include "sound.h"#include "SpriteMan.h"#include "..\My Game\resource.h"Functions | |
| TiXmlDocument | g_xmlDocument (g_xmlFileName) |
| TinyXML document for settings. | |
| void | ProcessFrame () |
| void | InitGame () |
| void | EndGame () |
| BOOL | KeyboardHandler (WPARAM keystroke) |
| LRESULT CALLBACK | WindowProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) |
| void | LoadGameSettings () |
| void | InitXMLSettings () |
| LRESULT CALLBACK | DefaultWindowProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) |
| HWND | CreateDefaultWindow (char *name, HINSTANCE hInstance, int nCmdShow) |
| int | DefaultWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) |
Variables | |
| BOOL | g_bActiveApp |
| TRUE if this is the active application. | |
| HWND | g_HwndApp |
| Application window handle. | |
| HINSTANCE | g_hInstance |
| Application instance handle. | |
| char | g_szGameName [] |
| Name of this game. | |
| int | g_nScreenWidth |
| Screen width. | |
| int | g_nScreenHeight |
| Screen height. | |
| char | g_errMsg [] |
| Error message if we had to abort. | |
| BOOL | g_errorExit |
| True if we had to abort. | |
| const char * | g_xmlFileName ="gamesettings.xml" |
| Settings file name. | |
| TiXmlElement * | g_xmlSettings = NULL |
| TinyXML element for settings tag. | |
| CSoundManager * | g_pSoundManager |
| CTimer | g_cTimer |
| The game timer. | |
Main file for Ian Parberry's game engine.
| HWND CreateDefaultWindow | ( | char * | name, |
| HINSTANCE | hInstance, | ||
| int | nCmdShow | ||
| ) |
Create a default window. Registers and creates a full screen window.
| name | the name of this application |
| hInstance | handle to the current instance of this application |
| nCmdShow | specifies how the window is to be shown |
| LRESULT CALLBACK DefaultWindowProc | ( | HWND | hwnd, |
| UINT | message, | ||
| WPARAM | wParam, | ||
| LPARAM | lParam | ||
| ) |
Default window procedure. Handler for messages from the Windows API.
| hwnd | window handle |
| message | message code |
| wParam | parameter for message |
| lParam | second parameter for message |
| int DefaultWinMain | ( | HINSTANCE | hInstance, |
| HINSTANCE | hPrevInstance, | ||
| LPSTR | lpCmdLine, | ||
| int | nCmdShow | ||
| ) |
Default WinMain. The main entry point for this application should call this function first.
| hInstance | handle to the current instance of this application |
| hPrevInstance | unused |
| lpCmdLine | unused |
| nCmdShow | specifies how the window is to be shown |
| void InitXMLSettings | ( | ) |
Initialize XML settings. Opens an XML file and prepares to read settings from it. Settings tag is loaded to XML element g_xmlSettings for later processing. Aborts if it cannot load the file or cannot find settings tag in loaded file.
| void LoadGameSettings | ( | ) |
Load game settings. Loads essential game settings from an xml file.
1.8.2