Handmade Network»Forums
Chen
102 posts / 2 projects
Some guy trying to make some video game.
Question about auto-generated opengl function loader
Hi folks! I want to write an Opengl function loader for my friend's game. Since I don't want to go through the pain of loading each function by hand, I want to write some kind of tool that helps me parse and generate the code that load these functions. However, I don't know where I can get a text file or an h file that has all the function declarations in them. My friend wants OpenGL 3.3 core profile API. If any of you folks know where I can get that, please tell me. Thanks a lot!
Mārtiņš Možeiko
2562 posts / 2 projects
Question about auto-generated opengl function loader
Edited by Mārtiņš Možeiko on
This is the official core profile header, but it includes up to latest GL 4.5 version + some extensions: https://github.com/KhronosGroup/O...ry/blob/master/api/GL/glcorearb.h

It is autogenerated from these xml files: https://github.com/KhronosGroup/OpenGL-Registry/tree/master/xml
You can parse these xml files yourself and generate only what you want (only specific version, no extensions, or something other). It includes pdf documentation describing xml format, but it is very simple.

There is glad generator that will generate only what you choose: http://glad.dav1d.de/ It will produce C header, and optionally very tiny loader that requires you to provide actual loading function.
Chen
102 posts / 2 projects
Some guy trying to make some video game.
Question about auto-generated opengl function loader
Thanks a lot! This was exactly I was looking for. I wanted to reply faster but apparently handmade network was offline. And for some reason there are Chinese advertisement threads appearing in the "work-in-progress" section of the website. I doubt if it's coincidence :(