Jump to content
  • Advertisement
Sign in to follow this  
Gooey

Buffer failing to generate value

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

If i use
GLuint buffer(0);
glGenBuffers(1, &buffer);
and it fails does it change the value of buffer? This feels like something i should know

Share this post


Link to post
Share on other sites
Advertisement

glGenBuffers changes the value of buffer. After the call buffer holds the ID of the generated buffer.

 

I don't see any reason why this should fail here.

 

How do you see it fails? An have you tried to read the OpenGL error message for more information?

Share this post


Link to post
Share on other sites
Practically speaking it can only fail if your context is not set on the current thread.
If it fails, buffer will be 0 in your case (either because it set it to 0 or because it didn’t change it from 0).
I believe it does change it to 0, but if you need to know it is easy to test by removing the context from the thread and defaulting your value to 10101010.


L. Spiro Edited by L. Spiro

Share this post


Link to post
Share on other sites

Practically speaking it can only fail if your context is not set on the current thread.

QFT.

As far as I can tell, the standard doesn't consider it possible forglGenBuffers() to fail. All it does is return the next N unused integers in a sequence, after all.

The only context in which I could see that function legitimately failing, is if the system is if the call overflows the stack, or you have exhausted the heap, in either of which case you have far larger problems...

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!