Jump to content
  • Advertisement
Sign in to follow this  
Toolmaker

OpenGL glGenBuffers vs glGenBuffersARB

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

I'm currently messing around with OpenGL on various computers, and I gave the application I wrote on my laptop a try on my work computer. While I earlier tried the demo on this machine, it worked fine because I was using glGenBuffersARB. I later on switched this back to glGenBuffers(And used all non-ARB versions further). However, it now crashes with a null-pointer exception on the glGenBuffers(I'm using TAO and C# here). What's the difference between the ARB and the non-ARB version? I tried OpenGL.org, but it doesn't tell anything about glGenBuffersARB. Toolmaker

Share this post


Link to post
Share on other sites
Advertisement
There is no difference apart from glGenBuffers being a core function, and glGenBuffersARB an extension function. Different names, different constants, same functionality. They are both function pointers which should be properly initialised at startup (I don't use TAO, but from glancing at the description, I'd expect that to happen automatically).
However, it is important to note that none of them is necessarily available on every system.

glGenBuffers will be available on every system that supports OpenGL 1.5 or better (VBO), but not necessarily with all targets (PBO also uses glGenBuffers, but is only available with OpenGL 2.1).

glGenBuffersARB is available if the extension string says that either the ARB vertex buffer or pixel buffer extension is present (or if both are present).
You should always check if an extension is available before using it (TAO probably has a convenient function for that).

Share this post


Link to post
Share on other sites
Under OpenGL 1.4 the vertex buffer object was an extension so it is available as an extension only i.e. GL_ARB_vertex_buffer_object

Under this extension the functions for vertex buffer objects have to be appended with ARB

so they are basically
glGenBuffersARB
glBindBufferARB
glDeleteBufferARB
..
..
(and so on)

In OpenGL 1.5 they were promoted to proper OpenGL functions, ie. the ones you say are crashing on some computers.
glGenBuffers
glBindBuffer
glDeleteBuffer
..
..
(and so on)

So in short, to use the functions without ARB you need OpenGL version > 1.4.

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!