• Advertisement
Sign in to follow this  

Segmentation Fault

This topic is 2455 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Random shot in the dark: Try moving line 16 in main.cpp after line 20. I don't think it's a good idea to be compiling and linking shaders without first properly initializing an OpenGL context and extensions.

Share this post


Link to post
Share on other sites
Hidden
Tell us which line the segfault is occuring on

Share this post


Link to post

Random shot in the dark: Try moving line 16 in main.cpp after line 20. I don't think it's a good idea to be compiling and linking shaders without first properly initializing an OpenGL context and extensions.


Nah that didn't work but thanks anyway.

Share this post


Link to post
Share on other sites
You need line 16 AND 18 after line 20, and you also need line 16 after line 18. Not only can you not compile and link your shader without a context, but you cannot even load the function pointers before the context, nor can you compile and link your shader until you have loaded the functions.

The three steps are exactly backwards: you're calling GL-functions before they are loaded, and then you're loading them, but before the context is set up. These threes steps must be performed the other way around.

Share this post


Link to post
Share on other sites

You need line 16 AND 18 after line 20, and you also need line 16 after line 18. Not only can you not compile and link your shader without a context, but you cannot even load the function pointers before the context, nor can you compile and link your shader until you have loaded the functions.

The three steps are exactly backwards: you're calling GL-functions before they are loaded, and then you're loading them, but before the context is set up. These threes steps must be performed the other way around.


Ok thanks that worked but now I am trying to bind the shader and I get a seg fault again.

Share this post


Link to post
Share on other sites
If you have changed the code and gotten different results, you need to post the new code. The GameDev Crystal Ball is broken, so we can't see what you did without you showing us wink.gif

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement