Engine
The Game Engine for Ian Parberry's "Introduction to Game Physics with Box2D"
 All Classes Files Functions Variables Pages
Public Member Functions | List of all members
CSpriteManager Class Reference

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.
 

Detailed Description

The sprite manager.

Member Function Documentation

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.

Parameters
spriteSprite type.
pPosition.
angleOrientation.
xscaleHorizontal scale. 1.0 is natural size.
yscaleVertical 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.

Parameters
spritesprite type
namesprite 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.

Parameters
devicePointer to Direct3D device.

The documentation for this class was generated from the following files: