glGetString() throws NullpointerException

Started by Tiamat, August 04, 2009, 21:32:05

Previous topic - Next topic

Tiamat

LWJGL 2.1.0

Exception in thread "main" java.lang.NullPointerException
   at org.lwjgl.opengl.GL11.glGetString(GL11.java:1677)

parameter doesn't seem to matter. Happens with GL_VENDOR, GL_RENDERER, GL_VERSION, GL_EXTENSIONS


oh yeah:
GeForce 8800 GTX on WinXP 64, in case it matters.
I wipe the silver bullet tears, and with every tear a dream. With every tear a dream.

Matzon


Tiamat

That works. Thanks.

But I don't understand why I should need a visible display to call those methods. What if I want to create the display based on that information?
I wipe the silver bullet tears, and with every tear a dream. With every tear a dream.

Ciardhubh

Quote from: Tiamat on August 04, 2009, 22:03:11
What if I want to create the display based on that information?


  • Display.create()
  • GL11.glGetString(...)
  • Display.destroy()
  • Display.create(...)

Matzon

or use a pbuffer to not show any visual stuff

You need to create a context to opengl to be able to call opengl commands - and this is done using display or pbuffer