From bc954774885f703ba68e01a7331abe6164835131 Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Thu, 30 Jan 2014 11:40:01 +0100 Subject: [PATCH] [Examples] Updated to use 1.1 API --- Source/Examples/OpenGL/3.x/HelloGL3.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Source/Examples/OpenGL/3.x/HelloGL3.cs b/Source/Examples/OpenGL/3.x/HelloGL3.cs index bbec20c711..e56537c48e 100644 --- a/Source/Examples/OpenGL/3.x/HelloGL3.cs +++ b/Source/Examples/OpenGL/3.x/HelloGL3.cs @@ -132,9 +132,7 @@ void CreateShaders() GL.AttachShader(shaderProgramHandle, fragmentShaderHandle); GL.LinkProgram(shaderProgramHandle); - Debug.WriteLine(GL.GetProgramInfoLog(shaderProgramHandle)); - GL.UseProgram(shaderProgramHandle); // Set uniforms @@ -151,19 +149,19 @@ void CreateShaders() void CreateVBOs() { - GL.GenBuffers(1, out positionVboHandle); + positionVboHandle = GL.GenBuffer(); GL.BindBuffer(BufferTarget.ArrayBuffer, positionVboHandle); GL.BufferData(BufferTarget.ArrayBuffer, new IntPtr(positionVboData.Length * Vector3.SizeInBytes), positionVboData, BufferUsageHint.StaticDraw); - GL.GenBuffers(1, out normalVboHandle); + normalVboHandle = GL.GenBuffer(); GL.BindBuffer(BufferTarget.ArrayBuffer, normalVboHandle); GL.BufferData(BufferTarget.ArrayBuffer, new IntPtr(positionVboData.Length * Vector3.SizeInBytes), positionVboData, BufferUsageHint.StaticDraw); - GL.GenBuffers(1, out eboHandle); + eboHandle = GL.GenBuffer(); GL.BindBuffer(BufferTarget.ElementArrayBuffer, eboHandle); GL.BufferData(BufferTarget.ElementArrayBuffer, new IntPtr(sizeof(uint) * indicesVboData.Length), @@ -179,7 +177,7 @@ void CreateVAOs() // This means we do not have to re-issue VertexAttribPointer calls // every time we try to use a different vertex layout - these calls are // stored in the VAO so we simply need to bind the correct VAO. - GL.GenVertexArrays(1, out vaoHandle); + vaoHandle = GL.GenVertexArray(); GL.BindVertexArray(vaoHandle); GL.EnableVertexAttribArray(0); @@ -214,7 +212,7 @@ protected override void OnRenderFrame(FrameEventArgs e) GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); GL.BindVertexArray(vaoHandle); - GL.DrawElements(BeginMode.Triangles, indicesVboData.Length, + GL.DrawElements(PrimitiveType.Triangles, indicesVboData.Length, DrawElementsType.UnsignedInt, IntPtr.Zero); SwapBuffers();