Jump to content
  • Advertisement
Sign in to follow this  

OpenGL glGen.* vs glCreate.*

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



So I'm learning OpenGL 4.5 for the first time. Can someone please explain what is the difference between glGen.* and glCreate.* and when should I use one rather than the other?


for example:- 

glGenBuffers vs glCreateBuffers


glGenVertexArrays vs glCreateVertexArrays



Edited by FantasyVII

Share this post

Link to post
Share on other sites

glCreate functiosn were introduced by GL_ARB_direct_state_access and the difference is that the old glGen functions don't actually create an OpenGL object at all - all that they do is give you an unused name, and the object is not created until the first time you bind it.  Since DSA gets rid of the need to bind-to-create, the glCreate functions will actually create the underlying GL object (with a default/uninitialized/undefined state as appropriate) as well as give you an unused name for it.


This is all discussed in issue #12 of the linked specification: "What's the purpose of the new Create* API?"


As a general rule, if you're using DSA then use glCreate, if you're not then use glGen, but don't mix-and-match.



I see. Thanks smile.png

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!