Updated to use the new Shapes.Cube interface.

This commit is contained in:
the_fiddler 2007-09-30 12:36:41 +00:00
parent 53bd24ac16
commit cccb14446a
2 changed files with 8 additions and 5 deletions

View file

@ -90,6 +90,7 @@ namespace Examples.Tutorial
/// </remarks>
public override void OnUpdateFrame(UpdateFrameEventArgs e)
{
/*
if (Keyboard[OpenTK.Input.Key.Escape])
{
this.Exit();
@ -101,7 +102,7 @@ namespace Examples.Tutorial
{
Fullscreen = !Fullscreen;
}
*/
angle += 3.0f;
if (angle > 720.0f)
angle -= 720.0f;

View file

@ -52,6 +52,8 @@ void main()
static float angle;
int vertex_shader_object, fragment_shader_object, shader_program;
Shapes.Cube shape = new Examples.Shapes.Cube();
#endregion
#region --- Constructors ---
@ -89,8 +91,8 @@ void main()
GL.EnableClientState(GL.Enums.EnableCap.VERTEX_ARRAY);
GL.EnableClientState(GL.Enums.EnableCap.COLOR_ARRAY);
GL.VertexPointer(3, GL.Enums.VertexPointerType.FLOAT, 0, Shapes.Cube.Vertices);
GL.ColorPointer(4, GL.Enums.ColorPointerType.UNSIGNED_BYTE, 0, Shapes.Cube.Colors);
GL.VertexPointer(3, GL.Enums.VertexPointerType.FLOAT, 0, shape.Vertices);
GL.ColorPointer(4, GL.Enums.ColorPointerType.UNSIGNED_BYTE, 0, shape.Colors);
int status;
@ -222,8 +224,8 @@ void main()
);
GL.Rotate(angle, 0.0f, 1.0f, 0.0f);
GL.DrawElements(GL.Enums.BeginMode.TRIANGLES, Shapes.Cube.Indices.Length,
GL.Enums.All.UNSIGNED_SHORT, Shapes.Cube.Indices);
GL.DrawElements(GL.Enums.BeginMode.TRIANGLES, shape.Indices.Length,
GL.Enums.All.UNSIGNED_SHORT, shape.Indices);
Context.SwapBuffers();
}