LWJGL
May 22, 2013, 01:33:12 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.9.0 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: Can't initialize shaders in GL20 or using ARB  (Read 1392 times)
floyd
Newbie
*
Posts: 6


« on: August 10, 2011, 23: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.
Logged
floyd
Newbie
*
Posts: 6


« Reply #1 on: August 10, 2011, 23:49:01 »

Oops, I put my email in the username field   Embarrassed
Logged
kappa
Administrator
Nerdus Imperius
*****
Posts: 1112



« Reply #2 on: August 11, 2011, 02:02:36 »

Oops, I put my email in the username field   Embarrassed
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).
Logged
floyd
Newbie
*
Posts: 6


« Reply #3 on: August 11, 2011, 02:09:13 »

Thank you Smiley

I looked at the source and the nullpointers coming from glcontext.getCapabilities();
Logged
floyd
Newbie
*
Posts: 6


« Reply #4 on: August 11, 2011, 13: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.
Logged
spasi
Nerdus Imperius
*****
Posts: 752



WWW
« Reply #5 on: August 11, 2011, 14:39:04 »

Sounds like you don't have a context current in the thread that's calling these OpenGL functions.
Logged
floyd
Newbie
*
Posts: 6


« Reply #6 on: August 11, 2011, 19:46:25 »

I thought lwjgl managed the context?
Logged
floyd
Newbie
*
Posts: 6


« Reply #7 on: August 12, 2011, 01: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.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!