LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Tiamat on August 04, 2009, 21:32:05

Title: glGetString() throws NullpointerException
Post by: Tiamat on August 04, 2009, 21:32:05
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.
Title: Re: glGetString() throws NullpointerException
Post by: Matzon on August 04, 2009, 21:59:48
Display.create first ?
Title: Re: glGetString() throws NullpointerException
Post by: Tiamat on August 04, 2009, 22:03:11
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?
Title: Re: glGetString() throws NullpointerException
Post by: Ciardhubh on August 05, 2009, 10:33:59
Quote from: Tiamat on August 04, 2009, 22:03:11
What if I want to create the display based on that information?

Title: Re: glGetString() throws NullpointerException
Post by: Matzon on August 05, 2009, 10:38:18
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