Game Development Reference
In-Depth Information
Figure 6.6
A quad made from two triangles.
class DrawSpriteState : IGameObject
{
#region IGameObject Members
public void Update(double elapsedTime)
{
}
public void Render()
{
}
#endregion
}
Remember to include the statement using Tao.OpenGl; at the top of the file so
OpenGL commands can be used. This game state will be used to test the sprite
drawing code. It needs to be the state that's loaded as soon as the program starts;
modify the code in Form.cs as follows.
public Form1()
{
// Add all the states that will be used.
_system.AddState("splash", new SplashScreenState(_system));
_system.AddState("title_menu", new TitleMenuState());
_system.AddState("sprite_test", new DrawSpriteState());
// Select the start state
 
Search WWH ::




Custom Search