glGetFloat Error!

Started by Temp_Holder, March 05, 2007, 22:11:19

Previous topic - Next topic

Temp_Holder

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???

Matzon

you are probably calling opengl methods from another thread than the one that created the canvas.

Temp_Holder

Its being called from the same thread,  well atleast it seems to be.  Anyhow are there any other reasons that this might happen?

Matzon

not that I am aware of..