Game Development Reference
In-Depth Information
}
}
public void Render()
{
Gl.glClearColor(1, 1, 1, 1);
Gl.glClear(Gl.GL_COLOR_BUFFER_BIT);
Gl.glFinish();
}
#endregion
}
This code has the state wait three seconds and then it changes the state to the title
menu. The splash screen state will render the screen white while it's active. We'll
have to cover 2D rendering and sprites before something interesting can be
shown.
class TitleMenuState : IGameObject
{
double _currentRotation = 0;
#region IGameObject Members
public void Update(double elapsedTime)
{
_currentRotation = 10 * elapsedTime;
}
public void Render()
{
Gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
Gl.glClear(Gl.GL_COLOR_BUFFER_BIT);
Gl.glPointSize(5.0f);
Gl.glRotated(_currentRotation, 0, 1, 0);
Gl.glBegin(Gl.GL_TRIANGLE_STRIP);
{
Gl.glColor4d(1.0, 0.0, 0.0, 0.5);
Gl.glVertex3d(-0.5, 0, 0);
Gl.glColor3d(0.0, 1.0, 0.0);
Gl.glVertex3d(0.5, 0, 0);
Search WWH ::




Custom Search