Can't initialize shaders in GL20 or using ARB

Started by floyd, August 11, 2011, 06:47:40

Previous topic - Next topic

floyd

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.

floyd

Oops, I put my email in the username field   :-[

kappa

Quote from: floyd on August 11, 2011, 06:49:01
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).

floyd

Thank you :)

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

floyd

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.

spasi

Sounds like you don't have a context current in the thread that's calling these OpenGL functions.

floyd


floyd

Quote from: spasi 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.

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.