PDA

View Full Version : How can I find or create a list of 3.3-core core only functions?



DragonautX
09-23-2017, 02:14 PM
Where can I find or create a list of core-only functions in the OpenGL 3.3 Core profile? Even with function loaders like GLAD, I'm considering trying to manually load the 3.3-core core-only functions for learning purposes.

Looking at the 3.3 core spec, I've noticed that the core functions are mentioned throughout the spec. in bold, but I was wondering if there was a formatted list available somewhere that shows the core-only functions. I can't seem to find a list like that in the spec.

Appendix J mentions extensions/header files, but doesn't have that type of list. It does say there that the registry contains gl.h and glext.h, which combined has all functions that you could possibly load, but looking at the header files, they also contain function prototypes for various versions of GL and extensions. I've seen something called ".spec" files in a few google searches. Will that help me?

If there isn't an official list like that, are there any methods on creating that list of core-only functions besides just looking for bolded functions in the spec? gl.h and glext.h seem to be formatted in certain ways, but I'm not sure how exactly. I thought since glVertexAttribPointer was a core function in 3.3 core and not an extension function, it'd be in gl.h, but I'm finding it in glext.h, so I'm not totally sure how the functions are listed in those files.

Alfonse Reinheart
09-23-2017, 02:30 PM
Where can I find or create a list of core-only functions in the OpenGL 3.3 Core profile? Even with function loaders like GLAD, I'm considering trying to manually load the 3.3-core core-only functions for learning purposes.

What's wrong with using GLAD's ability to create 3.3 loaders?


Looking at the 3.3 core spec, I've noticed that the core functions are mentioned throughout the spec. in bold, but I was wondering if there was a formatted list available somewhere that shows the core-only functions. I can't seem to find a list like that in the spec.

Why would there be? The specification defines the functions for that specification. The OpenGL 4.6 specification describes OpenGL 4.6, not 3.3.


Appendix J mentions extensions/header files, but doesn't have that type of list. It does say there that the registry contains gl.h and glext.h, which combined has all functions that you could possibly load, but looking at the header files, they also contain function prototypes for various versions of GL and extensions. I've seen something called ".spec" files in a few google searches. Will that help me?

The gl.xml file can help you, but really, you should stick to version-specific loaders like GLAD. They do all of that work for you. Parsing through gl.xml and writing a loader is a lot of work, and it's work that has been done. Many times over.

DragonautX
09-23-2017, 03:53 PM
There's nothing wrong with GLAD. I'm just curious what kinds of tools people would have used to make loaders like those. My first guess was that they would've just analyzed specifications manually, which was why I was wondering if maybe specifications contain a formatted list somewhere. I guess I was wrong about that.

I was curious about trying it out myself, trying to make my own loader. I was wondering what type of work/tools it would take to do something like that. You mentioned something called gl.xml. I didn't know that existed before. I took a look at it at the KhronosGroup OpenGL-Registry repo, but ya, that looks pretty intense. I've never done XML parsing before either. I won't try it for now, I'll just make a note of it.

I've done a little more research on the xml file, and I've noticed that it was designed to replace .spec files when it came to parsing data into header files. I know they're outdated now and not in the registry anymore, but I'm still curious what they looked like. Do you know where I can find a .spec file to look at? I tried googling "opengl spec file", but I can't find any of them.

GClements
09-23-2017, 06:53 PM
Current versions of the headers have 1.x functions in gl.h and the rest in glext.h. Functions are grouped by API version, so it's relatively easy to discard anything which was added after 3.3 or in an extension.

However, there's no easy way to distinguish the functions from 2.1 which have since been relegated to the compatibility profile from those which are still present in the core profile. For that, you could process the index of the 4.x reference pages (https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/indexflat.php) (which only list core profile functions), then find the intersection between the two sets.

Alfonse Reinheart
09-24-2017, 07:06 AM
I was curious about trying it out myself, trying to make my own loader. I was wondering what type of work/tools it would take to do something like that. You mentioned something called gl.xml. I didn't know that existed before. I took a look at it at the KhronosGroup OpenGL-Registry repo, but ya, that looks pretty intense. I've never done XML parsing before either. I won't try it for now, I'll just make a note of it.

I've done a little more research on the xml file, and I've noticed that it was designed to replace .spec files when it came to parsing data into header files. I know they're outdated now and not in the registry anymore, but I'm still curious what they looked like. Do you know where I can find a .spec file to look at? I tried googling "opengl spec file", but I can't find any of them.

Why would you want them? They'd be horribly out of date. And as someone who wrote a parser for the .spec "format", the XML version is loads better.

Really, the XML file is the only effective way to find this stuff.

DragonautX
09-24-2017, 03:59 PM
Why would you want them? They'd be horribly out of date. And as someone who wrote a parser for the .spec "format", the XML version is loads better.

Really, the XML file is the only effective way to find this stuff.

Like the idea about making a loader, it's more out of curiosity. I won't use them. I was wondering what it would've been like in the past to write a parser like that with .spec files. I was able to find them on my own after some searching, but thanks for the reply though.

DragonautX
09-24-2017, 04:04 PM
Current versions of the headers have 1.x functions in gl.h and the rest in glext.h. Functions are grouped by API version, so it's relatively easy to discard anything which was added after 3.3 or in an extension.

However, there's no easy way to distinguish the functions from 2.1 which have since been relegated to the compatibility profile from those which are still present in the core profile. For that, you could process the index of the 4.x reference pages (https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/indexflat.php) (which only list core profile functions), then find the intersection between the two sets.

-Thanks for the clarification. That makes sense, seeing the comments in glext.h. I thought gl.h contained only 1.1 functions for some reason, so I was a little confused there.

-That's an interesting approach, using the reference pages like that. Thanks for the idea.