mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-06-24 21:31:19 +00:00
Updated to use the new Shapes.Cube interface.
This commit is contained in:
parent
0b92d270df
commit
1e33b950c7
|
@ -90,6 +90,7 @@ namespace Examples.Tutorial
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public override void OnUpdateFrame(UpdateFrameEventArgs e)
|
public override void OnUpdateFrame(UpdateFrameEventArgs e)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
if (Keyboard[OpenTK.Input.Key.Escape])
|
if (Keyboard[OpenTK.Input.Key.Escape])
|
||||||
{
|
{
|
||||||
this.Exit();
|
this.Exit();
|
||||||
|
@ -101,7 +102,7 @@ namespace Examples.Tutorial
|
||||||
{
|
{
|
||||||
Fullscreen = !Fullscreen;
|
Fullscreen = !Fullscreen;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
angle += 3.0f;
|
angle += 3.0f;
|
||||||
if (angle > 720.0f)
|
if (angle > 720.0f)
|
||||||
angle -= 720.0f;
|
angle -= 720.0f;
|
||||||
|
|
|
@ -52,6 +52,8 @@ void main()
|
||||||
static float angle;
|
static float angle;
|
||||||
int vertex_shader_object, fragment_shader_object, shader_program;
|
int vertex_shader_object, fragment_shader_object, shader_program;
|
||||||
|
|
||||||
|
Shapes.Cube shape = new Examples.Shapes.Cube();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region --- Constructors ---
|
#region --- Constructors ---
|
||||||
|
@ -89,8 +91,8 @@ void main()
|
||||||
|
|
||||||
GL.EnableClientState(GL.Enums.EnableCap.VERTEX_ARRAY);
|
GL.EnableClientState(GL.Enums.EnableCap.VERTEX_ARRAY);
|
||||||
GL.EnableClientState(GL.Enums.EnableCap.COLOR_ARRAY);
|
GL.EnableClientState(GL.Enums.EnableCap.COLOR_ARRAY);
|
||||||
GL.VertexPointer(3, GL.Enums.VertexPointerType.FLOAT, 0, Shapes.Cube.Vertices);
|
GL.VertexPointer(3, GL.Enums.VertexPointerType.FLOAT, 0, shape.Vertices);
|
||||||
GL.ColorPointer(4, GL.Enums.ColorPointerType.UNSIGNED_BYTE, 0, Shapes.Cube.Colors);
|
GL.ColorPointer(4, GL.Enums.ColorPointerType.UNSIGNED_BYTE, 0, shape.Colors);
|
||||||
|
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
|
@ -222,8 +224,8 @@ void main()
|
||||||
);
|
);
|
||||||
GL.Rotate(angle, 0.0f, 1.0f, 0.0f);
|
GL.Rotate(angle, 0.0f, 1.0f, 0.0f);
|
||||||
|
|
||||||
GL.DrawElements(GL.Enums.BeginMode.TRIANGLES, Shapes.Cube.Indices.Length,
|
GL.DrawElements(GL.Enums.BeginMode.TRIANGLES, shape.Indices.Length,
|
||||||
GL.Enums.All.UNSIGNED_SHORT, Shapes.Cube.Indices);
|
GL.Enums.All.UNSIGNED_SHORT, shape.Indices);
|
||||||
|
|
||||||
Context.SwapBuffers();
|
Context.SwapBuffers();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue