Main file for your game.
More...
#include "gamedefines.h"
#include "SndList.h"
#include "Box2D\Box2D.h"
#include "RenderWorld.h"
#include "ObjectWorld.h"
|
b2World | g_b2dPhysicsWorld (b2Vec2(0, RW2PW(-100))) |
| Box2D Physics World.
|
|
int | DefaultWinMain (HINSTANCE, HINSTANCE, LPSTR, int) |
|
LRESULT CALLBACK | DefaultWindowProc (HWND, UINT, WPARAM, LPARAM) |
|
void | CreateWorldEdges () |
|
void | CreateBook (float x, float y) |
|
void | CreateBall (float x, float y) |
|
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) |
|
void CreateBall |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
Place a ball in Physics World and Object World.
- Parameters
-
x | Horizontal coordinate in Physics World units. |
y | Vertical coordinate in Physics World units. |
void CreateBook |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
Place a book in Physics World and Object World.
- Parameters
-
x | Horizontal coordinate in Physics World units. |
y | Vertical coordinate in Physics World units. |
void CreateWorldEdges |
( |
| ) |
|
Create world edges in Physics World. Place Box2D edge shapes in the Physics World in places that correspond to the top, bottom, right, and left edges of the screen in Render World. The left and right edges continue upwards for a distance. There is no top to the world.
BOOL KeyboardHandler |
( |
WPARAM |
k | ) |
|
Keyboard handler. Take the appropriate action when the user mashes a key on the keyboard.
- Parameters
-
k | Virtual key code for the key pressed |
- Returns
- TRUE if the game is to exit
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
-
h | window handle |
m | message code |
w | parameter for message |
l | second 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
-
hI | handle to the current instance of this application |
hP | unused |
lpC | unused |
nCS | specifies how the window is to be shown |
- Returns
- TRUE if application terminates correctly