Game Development Reference
In-Depth Information
There is a drop-down box next to Platform Target. Choose x86; this will make
the program build for 32-bit systems.
Finally, if you get an Assertion Failed message with the text Could not
open file, [face.tif] , then face.tif is not in the binary directory; either
copy the file into the correct location or make sure you added it to the solution
correctly.
Textured Sprites
Once textures are being loaded, it's time to start using them. Texture maps are
indexed from 0 to 1 on both axes. 0,0 is the top-left corner and 1,1 is the bottom
right. For textures, the axes aren't called X and Y; instead, they're called U and V.
Figure 6.10 shows how the 2D U,V coordinates for each vertex are mapped on to
the 3D vertex positions. It will be easier to play with the U,V mapping once
texturing is working with the quad example.
Return to the DrawSpriteState class. A constructor that takes in a Tex-
tureManager needs to be created.
class DrawSpriteState : IGameObject
{
TextureManager _textureManager;
public DrawSpriteState(TextureManager textureManager)
Figure 6.10
U,V mapping.
 
Search WWH ::




Custom Search