Hello Guest

Can't initialize shaders in GL20 or using ARB

  • 7 Replies
  • 5278 Views
Can't initialize shaders in GL20 or using ARB
« on: August 11, 2011, 06:47:40 »
I have a graphics card with OpenGL 4.1, and I tried loading shaders using GL20.glCreateShader(GL20.GL_VERTEX_SHADER); but I got a nullpointerexception in GL20 line 220, so I switched to ARBShaderObjects.glCreateShaderObjectARB(ARBVertexShader.GL_VERTEX_SHADER_ARB); and got a nullpointerexception on line 91 of ARBShaderObjects. Is there some other way I could create the shaders?

I can't create fragment shaders either.

Re: Can't initialize shaders in GL20 or using ARB
« Reply #1 on: August 11, 2011, 06:49:01 »
Oops, I put my email in the username field   :-[

*

Offline kappa

  • *****
  • 1316
Re: Can't initialize shaders in GL20 or using ARB
« Reply #2 on: August 11, 2011, 09:02:36 »
Oops, I put my email in the username field   :-[
I've renamed your username to just floyd, however SMF requires you change your password, you'll be emailed a new one (can change it back if you like).

RE: Can't initialize shaders in GL20 or using ARB
« Reply #3 on: August 11, 2011, 09:09:13 »
Thank you :)

I looked at the source and the nullpointers coming from glcontext.getCapabilities();

Re: Can't initialize shaders in GL20 or using ARB
« Reply #4 on: August 11, 2011, 20:28:20 »
Any ideas? I'm running it on a radeon hd 6870 (gl 4.1) and I tried it on my laptop which has some nivdia card, and I'm still getting the nullpointer inside lwjgl. I downloaded a nightly build and it did the same thing.

*

Offline spasi

  • *****
  • 2198
    • WebHotelier
Re: Can't initialize shaders in GL20 or using ARB
« Reply #5 on: August 11, 2011, 21:39:04 »
Sounds like you don't have a context current in the thread that's calling these OpenGL functions.

Re: Can't initialize shaders in GL20 or using ARB
« Reply #6 on: August 12, 2011, 02:46:25 »
I thought lwjgl managed the context?

Re: Can't initialize shaders in GL20 or using ARB
« Reply #7 on: August 12, 2011, 08:22:23 »
Sounds like you don't have a context current in the thread that's calling these OpenGL functions.

OOOHHHH! I misread that! I was accidentally loading the shaders in my constructor instead of the way I needed to.
I was going to give up if I couldn't get it to load, so thank you very, very much.