Game Development Reference
In-Depth Information
Figure 7.1
A font texture.
texture manager using the id font . Create a new sprite, set the new font tex-
ture as the texture, and render the font in the render loop.
class TextTestState : IGameObject
{
Sprite _text = new Sprite();
Renderer _renderer = new Renderer();
public TextTestState(TextureManager textureManager)
{
_text.Texture = textureManager.Get("font");
}
public void Render()
{
Gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
Gl.glClear(Gl.GL_COLOR_BUFFER_BIT);
_renderer.DrawSprite(_text);
}
public void Update(double elapsedTime)
{
}
}
Search WWH ::




Custom Search