LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Temp_Holder on March 05, 2007, 22:11:19

Title: glGetFloat Error!
Post by: Temp_Holder on March 05, 2007, 22:11:19
Hey Iam working on this editor using LWJGL,  and I recently ran into a problem I dont remember getting before today.  Anyhow the problem is that When i run and click on the AWTCanvas since I have the window embedded in a Swing application,  I get a Null Pointer error that looks something like this.

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at org.lwjgl.opengl.GL11.glGetFloat(GL11.java:1299)
        at axiom.util.Util.getOGLpos(Util.java:60) ...
        ...

Now I was wondering what could be causing it?  Iam guessing it has something to do with the MODEL_VIEW_MATRIX not being instantiated or something,  Iam not really sure but this is my code.

        FloatBuffer modelview = BufferUtils.createFloatBuffer(16);
        GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelview);

anyone have any ideas???
Title: Re: glGetFloat Error!
Post by: Matzon on March 06, 2007, 07:06:33
you are probably calling opengl methods from another thread than the one that created the canvas.
Title: Re: glGetFloat Error!
Post by: Temp_Holder on March 10, 2007, 01:04:15
Its being called from the same thread,  well atleast it seems to be.  Anyhow are there any other reasons that this might happen?
Title: Re: glGetFloat Error!
Post by: Matzon on March 10, 2007, 09:24:41
not that I am aware of..