From cccb14446af5f5f9edfa2e1979b5fdeb45e5b9ef Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sun, 30 Sep 2007 12:36:41 +0000 Subject: [PATCH] Updated to use the new Shapes.Cube interface. --- Source/Examples/Tutorial/T03_Immediate_Mode_Cube.cs | 3 ++- Source/Examples/Tutorial/T10_GLSL_Cube.cs | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/Examples/Tutorial/T03_Immediate_Mode_Cube.cs b/Source/Examples/Tutorial/T03_Immediate_Mode_Cube.cs index 9e2c5ffe..6caa5c84 100644 --- a/Source/Examples/Tutorial/T03_Immediate_Mode_Cube.cs +++ b/Source/Examples/Tutorial/T03_Immediate_Mode_Cube.cs @@ -90,6 +90,7 @@ namespace Examples.Tutorial /// 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; diff --git a/Source/Examples/Tutorial/T10_GLSL_Cube.cs b/Source/Examples/Tutorial/T10_GLSL_Cube.cs index 6bb79632..b17c7382 100644 --- a/Source/Examples/Tutorial/T10_GLSL_Cube.cs +++ b/Source/Examples/Tutorial/T10_GLSL_Cube.cs @@ -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(); }