PDA

View Full Version : Question about profiles, opengl versions and extensions



buff3r_ov3rfl0w
09-03-2015, 04:31 AM
Hi, I am not sure where to ask this question, so I decided to give it a try here.

I wonder how to load extensions based on OpenGL versions? I am quite used to load extensions individually, but I have written a small bash script to download and parse latest headers and now have some doubts about what to load and what not. My script is reading through header and looking for "#define GL_VERSION and than looking for any procedure typedefs (actually prototypes) that follows before next version is defined and than generating some code to load those. Now I am just not really sure how available prototypes works in regard to versioning. Should I load all previous versions as well? For example if user define verson 3_1, should I load 3.0, and 2.1, 2.0 and so on all the way to 1.2?

mbentrup
09-04-2015, 12:31 AM
Hi, I am not sure where to ask this question, so I decided to give it a try here.

I wonder how to load extensions based on OpenGL versions? I am quite used to load extensions individually, but I have written a small bash script to download and parse latest headers and now have some doubts about what to load and what not. My script is reading through header and looking for "#define GL_VERSION and than looking for any procedure typedefs (actually prototypes) that follows before next version is defined and than generating some code to load those. Now I am just not really sure how available prototypes works in regard to versioning. Should I load all previous versions as well? For example if user define verson 3_1, should I load 3.0, and 2.1, 2.0 and so on all the way to 1.2?

Up to OpenGL 3.0 every OpenGL release included all functions of the prior releases. For OpenGL 3.1 the ARB decided to remove a bunch of functions and changed the semantics of some others, but it allowed the driver to provide the old stuff anyway as part of the GL_ARB_compatibility extension. With 3.2 the ARB let the application decide if it wants the old stuff removed or not by introducing the core and compatibility profiles.

So generally you should include the earlier versions, as the headers contain only the prototypes of the new functions of every release. However, you have to be careful about removed functions, but you cannot see this in the header files. However, this information is contained in the XML API registry files.