0 Members and 1 Guest are viewing this topic.
unsafe { fixed (Vector3* Ptr = &Sim.BodyMesh.TransformedVertices[0]) Gl.glVertexPointer(3, Gl.GL_FLOAT, (int)((int)Marshal.OffsetOf(typeof(Vector3), "m_Y") - (int)Marshal.OffsetOf(typeof(Vector3), "m_X") - sizeof(float)), (IntPtr)Ptr); fixed (Vector2* Ptr = &Sim.BodyMesh.TransformedTexVertices[0]) Gl.glTexCoordPointer(2, Gl.GL_FLOAT, (int)((int)Marshal.OffsetOf(typeof(Vector3), "m_X") - (int)Marshal.OffsetOf(typeof(Vector3), "m_Y") - sizeof(float)), (IntPtr)Ptr); Gl.glDrawElements(Gl.GL_TRIANGLES, Sim.BodyMesh.FaceCount * 3, Gl.GL_UNSIGNED_INT, Sim.BodyMesh.FaceIndexes); }
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
I'm not sure my vertex-arrays even have color components... how do I disable 'em?
glDisableClientState(GL_COLOR_ARRAY);