OSDN Git Service

Use compat VBO functions. Fixes crash when only ARB VBO functions are present.
authorLatif Khalifa <latifer@streamgrid.net>
Mon, 8 Aug 2011 17:46:54 +0000 (17:46 +0000)
committerLatif Khalifa <latifer@streamgrid.net>
Mon, 8 Aug 2011 17:46:54 +0000 (17:46 +0000)
git-svn-id: https://radegast.googlecode.com/svn/trunk@1084 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/GUI/Rendering/RenderingHelpers.cs

index f5445ee..a452a75 100644 (file)
@@ -55,17 +55,17 @@ namespace Radegast.Rendering
             if (VertexVBO == -1)\r
             {\r
                 Vertex[] vArray = face.Vertices.ToArray();\r
-                GL.GenBuffers(1, out VertexVBO);\r
-                GL.BindBuffer(BufferTarget.ArrayBuffer, VertexVBO);\r
-                GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(vArray.Length * VertexSize), vArray, BufferUsageHint.StaticDraw);\r
+                Compat.GenBuffers(out VertexVBO);\r
+                Compat.BindBuffer(BufferTarget.ArrayBuffer, VertexVBO);\r
+                Compat.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(vArray.Length * VertexSize), vArray, BufferUsageHint.StaticDraw);\r
             }\r
 \r
             if (IndexVBO == -1)\r
             {\r
                 ushort[] iArray = face.Indices.ToArray();\r
-                GL.GenBuffers(1, out IndexVBO);\r
-                GL.BindBuffer(BufferTarget.ElementArrayBuffer, IndexVBO);\r
-                GL.BufferData(BufferTarget.ElementArrayBuffer, (IntPtr)(iArray.Length * sizeof(ushort)), iArray, BufferUsageHint.StaticDraw);\r
+                Compat.GenBuffers(out IndexVBO);\r
+                Compat.BindBuffer(BufferTarget.ElementArrayBuffer, IndexVBO);\r
+                Compat.BufferData(BufferTarget.ElementArrayBuffer, (IntPtr)(iArray.Length * sizeof(ushort)), iArray, BufferUsageHint.StaticDraw);\r
             }\r
         }\r
     }\r