Pool End Game
Chapter 3 of Ian Parberry's "Introduction to Game Physics with Box2D"
 All Classes Files Functions Variables Enumerations Pages
Functions | Variables
MyGame.cpp File Reference

Main file for your game. More...

#include "gamedefines.h"
#include "SndList.h"
#include "RenderWorld.h"
#include "ObjectWorld.h"

Functions

int DefaultWinMain (HINSTANCE, HINSTANCE, LPSTR, int)
 
LRESULT CALLBACK DefaultWindowProc (HWND, UINT, WPARAM, LPARAM)
 
void CreateObjects ()
 Create all game objects.
 
void BeginGame ()
 Start the game.
 
void InitGame ()
 Initialize and start the game.
 
void EndGame ()
 Shut down game and release resources.
 
void RenderFrame ()
 Render a frame of animation.
 
void ProcessFrame ()
 
BOOL KeyboardHandler (WPARAM k)
 
LRESULT CALLBACK WindowProc (HWND h, UINT m, WPARAM w, LPARAM l)
 
int WINAPI WinMain (HINSTANCE hI, HINSTANCE hP, LPSTR lpC, int nCS)
 

Variables

int g_nScreenHeight
 
char g_szGameName [256]
 Name of this game.
 
GameStateType g_nGameState
 Current game state.
 
CTimer g_cTimer
 The game timer.
 
CSoundManager * g_pSoundManager
 The sound manager.
 
CRenderWorld g_cRenderWorld
 The Render World.
 
CObjectWorld g_cObjectWorld
 The Object World.
 

Detailed Description

Main file for your game.

Function Documentation

BOOL KeyboardHandler ( WPARAM  k)

Keyboard handler. Take the appropriate action when the user mashes a key on the keyboard.

Parameters
kVirtual key code for the key pressed
Returns
TRUE if the game is to exit

< Small change in position.

< Small change in angle.

void ProcessFrame ( )

Process a frame of animation. Called once a frame to animate game objects and take appropriate action if the player has won or lost.

LRESULT CALLBACK WindowProc ( HWND  h,
UINT  m,
WPARAM  w,
LPARAM  l 
)

Window procedure. Handler for messages from the Windows API. Dont mess with these unless you really know what you're doing.

Parameters
hwindow handle
mmessage code
wparameter for message
lsecond parameter for message
Returns
0 if message is handled
int WINAPI WinMain ( HINSTANCE  hI,
HINSTANCE  hP,
LPSTR  lpC,
int  nCS 
)

Winmain. Main entry point for this application. Dont mess with these unless you really know what you're doing.

Parameters
hIhandle to the current instance of this application
hPunused
lpCunused
nCSspecifies how the window is to be shown
Returns
TRUE if application terminates correctly