1
Vote

[Linux] DrawUserPrimitives ends with NRE

description

It happens on:
GL11.EnableClientState(All11.VertexArray);
and the stack trace is
System.NullReferenceException: Object reference not set to an instance of an object
at OpenTK.Graphics.ES11.GL.EnableClientState (All array) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.Graphics.GLStateManager.VertexArray (Boolean enable) [0x00011] in /home/konrad/Desktop/MGTest/MonoGame.Framework/Graphics/States/GLStateManager.cs:38
at Microsoft.Xna.Framework.Graphics.VertexDeclaration.PrepareForUse (Microsoft.Xna.Framework.Graphics.VertexDeclaration vd) [0x00000] in /home/konrad/Desktop/MGTest/MonoGame.Framework/Desktop/Graphics/Vertices/VertexDeclaration.cs:90
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.DrawUserPrimitives[VertexPositionColor] (PrimitiveType primitiveType, Microsoft.Xna.Framework.Graphics.VertexPositionColor[] vertexData, Int32 vertexOffset, Int32 primitiveCount) [0x00054] in /home/konrad/Desktop/MGTest/MonoGame.Framework/Linux/Graphics/GraphicsDevice.cs:576
at Tetris.Engine.Draw (Microsoft.Xna.Framework.GameTime gameTime) [0x000c4] in /home/konrad/Desktop/MGTest/Inner/Tetris/Engine.cs:222
at Microsoft.Xna.Framework.Game.DoDraw (Microsoft.Xna.Framework.GameTime gameTime) [0x00022] in /home/konrad/Desktop/MGTest/MonoGame.Framework/Game.cs:579
at Microsoft.Xna.Framework.GameWindow.OnRenderFrame (System.Object sender, OpenTK.FrameEventArgs e) [0x00126] in /home/konrad/Desktop/MGTest/MonoGame.Framework/Linux/GameWindow.cs:238
at OpenTK.GameWindow.OnRenderFrame (OpenTK.FrameEventArgs e) [0x00000] in <filename unknown>:0
(...)
 
Maybe it is incorrent OpenTK version - I'm using the newest from http://www.opentk.com/files/download-opentk.html

comments

kkruczynski wrote Apr 14, 2012 at 11:43 AM

Looks like it could work with newest OpenTK, however MonoGame 2.5 does not compile with it... Older version works, though.