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

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
 

Detailed Description

The sprite.

The sprite class contains basic information for drawing a billboard sprite in Render World.

Member Function Documentation

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.

Parameters
devicePointer to D3D device.
pPoint in 3D space at which to draw the sprite.
angleAngle of rotation.
xscaleHorizontal scale factor.
yscaleVertical 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.

Parameters
devicePointer to D3D device.
filenamethe name of the image file
void C3DSprite::Release ( )

Release sprite.

Release sprite vertex buffer and textures.


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