Engine
The Game Engine for Ian Parberry's "Introduction to Game Physics with Box2D"
|
The sprite. More...
#include <Sprite.h>
Public Member Functions | |
C3DSprite () | |
Constructor. | |
BOOL | Load (LPDIRECT3DDEVICE9 device, char *filename) |
Load texture image from file. | |
void | Draw (LPDIRECT3DDEVICE9 device, D3DXVECTOR3 p, float angle=0.0f, float xscale=1.0f, float yscale=1.0f) |
Draw sprite at point p in 3D space. | |
void | Release () |
Release sprite. | |
Friends | |
class | CSpriteManager |
The sprite.
The sprite class contains basic information for drawing a billboard sprite in Render World.
void C3DSprite::Draw | ( | LPDIRECT3DDEVICE9 | device, |
D3DXVECTOR3 | p, | ||
float | angle = 0.0f , |
||
float | xscale = 1.0f , |
||
float | yscale = 1.0f |
||
) |
Draw sprite at point p in 3D space.
Draws the sprite image at a given point in 3D space relative to the center of the screen.
device | Pointer to D3D device. |
p | Point in 3D space at which to draw the sprite. |
angle | Angle of rotation. |
xscale | Horizontal scale factor. |
yscale | Vertical scale factor. |
BOOL C3DSprite::Load | ( | LPDIRECT3DDEVICE9 | device, |
char * | filename | ||
) |
Load texture image from file.
The Load function loads the sprite image into a texture from a given file name. It also creates a vertex buffer for the billboard image containing 4 corner vertices spaced apart the appropriate width and height.
device | Pointer to D3D device. |
filename | the name of the image file |
void C3DSprite::Release | ( | ) |
Release sprite.
Release sprite vertex buffer and textures.