![]() |
Engine
The Game Engine for Ian Parberry's "Introduction to Game Physics with Box2D"
|
The sprite manager. More...
#include <SpriteMan.h>
Public Member Functions | |
| CSpriteManager () | |
| Constructor. | |
| ~CSpriteManager () | |
| Destructor. | |
| void | Load (int sprite, char *name) |
| Load sprite. | |
| void | Draw (int sprite, D3DXVECTOR3 p, float angle=0.0f, float xscale=1.0f, float yscale=1.0f) |
| Draw sprite. | |
| void | Release () |
| Release textures. | |
| void | SetDevice (LPDIRECT3DDEVICE9 device) |
| Set the Direct3D device. | |
The sprite manager.
| void CSpriteManager::Draw | ( | int | sprite, |
| D3DXVECTOR3 | p, | ||
| float | angle = 0.0f, |
||
| float | xscale = 1.0f, |
||
| float | yscale = 1.0f |
||
| ) |
Draw sprite.
Draw a sprite to the back buffer.
| sprite | Sprite type. |
| p | Position. |
| angle | Orientation. |
| xscale | Horizontal scale. 1.0 is natural size. |
| yscale | Vertical scale. 1.0 is natural size. |
| void CSpriteManager::Load | ( | int | sprite, |
| char * | name | ||
| ) |
Load sprite.
Load sprite from info in XML settings. Loads information about the sprite from global variable g_xmlSettings, then loads the sprite images as per that information. Aborts if something goes wrong.
| sprite | sprite type |
| name | sprite name in XML file |
| void CSpriteManager::Release | ( | ) |
Release textures.
Release textures and vertex buffers from all sprites.
| void CSpriteManager::SetDevice | ( | LPDIRECT3DDEVICE9 | device | ) |
Set the Direct3D device.
Save pointer to D3D device in a private member variable for later use.
| device | Pointer to Direct3D device. |
1.8.2