diff --git a/OpenRA.Renderer.Cg/GraphicsDevice.cs b/OpenRA.Renderer.Cg/GraphicsDevice.cs index b2bf86c2d0..34bc8315f0 100755 --- a/OpenRA.Renderer.Cg/GraphicsDevice.cs +++ b/OpenRA.Renderer.Cg/GraphicsDevice.cs @@ -280,14 +280,14 @@ namespace OpenRA.Renderer.Cg public void DrawIndexedPrimitives( PrimitiveType pt, Range vertices, Range indices ) { Gl.glDrawElements( ModeFromPrimitiveType( pt ), indices.End - indices.Start, - Gl.GL_UNSIGNED_SHORT, new IntPtr( indices.Start * 2 ) ); + Gl.GL_UNSIGNED_INT, new IntPtr( indices.Start * 4 ) ); CheckGlError(); } public void DrawIndexedPrimitives( PrimitiveType pt, int numVerts, int numPrimitives ) { - Gl.glDrawElements( ModeFromPrimitiveType( pt ), numPrimitives * IndicesPerPrimitive( pt ), - Gl.GL_UNSIGNED_SHORT, IntPtr.Zero ); + Gl.glDrawElements( ModeFromPrimitiveType( pt ), numPrimitives * IndicesPerPrimitive( pt ), + Gl.GL_UNSIGNED_INT, IntPtr.Zero); CheckGlError(); } diff --git a/OpenRA.Renderer.Gl/GraphicsDevice.cs b/OpenRA.Renderer.Gl/GraphicsDevice.cs index e66589cc65..d6297de2f4 100755 --- a/OpenRA.Renderer.Gl/GraphicsDevice.cs +++ b/OpenRA.Renderer.Gl/GraphicsDevice.cs @@ -273,14 +273,14 @@ namespace OpenRA.Renderer.Glsl public void DrawIndexedPrimitives( PrimitiveType pt, Range vertices, Range indices ) { Gl.glDrawElements( ModeFromPrimitiveType( pt ), indices.End - indices.Start, - Gl.GL_UNSIGNED_INT, new IntPtr( indices.Start * 4 ) ); + Gl.GL_UNSIGNED_INT, new IntPtr( indices.Start * 4 ) ); CheckGlError(); } public void DrawIndexedPrimitives( PrimitiveType pt, int numVerts, int numPrimitives ) { Gl.glDrawElements( ModeFromPrimitiveType( pt ), numPrimitives * IndicesPerPrimitive( pt ), - Gl.GL_UNSIGNED_INT, IntPtr.Zero); + Gl.GL_UNSIGNED_INT, IntPtr.Zero); CheckGlError(); }