Jump to content
  • Advertisement
Sign in to follow this  
fread

OpenGL glGenFramebuffers access violation in gl 3 . Deprecated?

This topic is 1596 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

Hello everyone,

I've recently started learning OpenGl3.

I am getting access violation on "glGenFramebuffers" call (using glew library).

Is glGenFramebuffers deprecated in GL3?

How can I replace it?
Thanks in advance ;s

Share this post


Link to post
Share on other sites
Advertisement

As far as I know, glGenFramebuffers was added in OpenGL 3.0, so it should not be deprecated. :) Can you provide more details about what is happening (source code, full error message, ...)?

Share this post


Link to post
Share on other sites
No, they didn't deprecate the creation of framebuffers in the version it was added :L you're probably trying to write to a read-only framebuffer or not loading the correct opengl version in your program.

Share this post


Link to post
Share on other sites

Have you called glewInit() at the start of your program? Given you have an access violation, the glGenFramebuffers pointer is probably null.

Share this post


Link to post
Share on other sites

Have you called glewInit() at the start of your program? Given you have an access violation, the glGenFramebuffers pointer is probably null.

 

 I second that.

Share this post


Link to post
Share on other sites

I've called glewInit and I've already used glUseProgram, ETC.

Only glGenFramebuffers is NULL.

This condition is true:

if(glGenFramebuffers  == 0) 
         printf("Error, glGenFramebuffers not present!")

It crashes on the frst call.

it's very strange because glGenFramebuffers  is not NULL in a backwards compatitilibity mode.

Share this post


Link to post
Share on other sites

Sounds like a driver bug to me. glGenFramebuffers should be available in compatibility and core contexts. Are you sure you're creating a GL 3.x context? If you are, then you can try setting glewExperimental to GL_TRUE before calling glewInit() and see if that works. Something like this:

glewExperimental = GL_TRUE;
if ( glewInit() != GLEW_OK ) {
  ...
}

Share this post


Link to post
Share on other sites

try setting glewExperimental to GL_TRUE before calling glewInit()

Sadly, this is pretty much always required for GLEW these days. I spent an hour banging my head against this just a few weeks back.

 

I keep hoping for a new glew release that enables core functionality by default. I'm not holding my breath though.

Edited by swiftcoder

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!