Game Development Reference
In-Depth Information
Chapter 2. Loading and Using Textures
Textures are important, both for 2D and 3D games. They allow us to map images onto ob-
jects. In this chapter, we will look into ways of loading textures into memory and mapping
them onto shapes. The
Sprite
class will make an appearance, and we will see how it dif-
fers from the
Shape
class. Finally, we will see how to keep resources safe from destruc-
tion throughout the lifetime of the game.
In this chapter, we will cover:
• Loading textures
• Rendering shapes with textures
• What is a sprite?
• Managing resources