![]() |
Ball and Spring Toy
Ian Parberry's "Introduction to Game Physics"
|
The game class.
#include <Game.h>
Public Member Functions | |
~CGame () | |
Destructor. | |
void | Initialize () |
Initialize the game. More... | |
void | ProcessFrame () |
Process an animation frame. More... | |
void | Release () |
Release the renderer. More... | |
Private Member Functions | |
void | LoadSounds () |
Load sounds. More... | |
void | BeginGame () |
Begin playing the game. More... | |
void | KeyboardHandler () |
The keyboard handler. More... | |
void | RenderFrame () |
Render an animation frame. More... | |
void | CreateObjects () |
Create game objects. More... | |
Additional Inherited Members | |
![]() | |
static CRenderer * | m_pRenderer = nullptr |
Pointer to the renderer. | |
static CObjectManager * | m_pObjectManager = nullptr |
Pointer to the object manager. | |
static eBody | m_eCurrentBody = (eBody)0 |
Current body type. | |
|
private |
Clear any old objects out of the object manager and create some new ones.
|
private |
Ask the object manager to create the game objects.
void CGame::Initialize | ( | ) |
Initialize the renderer, load the images for the background, and start the game.
|
private |
Poll the keyboard state and respond to the key presses that happened since the last frame.
|
private |
Initialize the audio player and load game sounds.
void CGame::ProcessFrame | ( | ) |
Handle keyboard input, move the game objects and render them in their new positions and orientations. Notify the audio player at the start of each frame so that it can prevent multiple copies of a sound from starting on the same frame. Notify the timer of the start and end of the frame so that it can calculate frame time.
void CGame::Release | ( | ) |
Release all of the DirectX12 objects by deleting the renderer.
|
private |
Ask the object manager to draw the game objects. The renderer is notified of the start and end of the frame so that it can let Direct3D do its pipelining jiggery-pokery.