While working on a project involving OpenGL, I quickly came across GLAD, which is a library that loads all the OpenGL function definitions and constants that are used in the later versions, such as 3.3 (because the operating system doesn't care anymore). If you scroll down to the bottom, under the Options header, you'll find an option called Omit KHR. The only OpenGL tutorials I've found simply say to make sure that its checked, but I'd like to know what it's doing. A quick look into the source seems to show that it loads platform consistent definitions for things like integers, but is this correct? Here's a link to it: khrplatform.h
Admittedly, this is actually for GLFW, but if you want to download it from GLAD or even from the Khronos Group itself, they should be the same.
The Khronos group maintains several industry standard APIs: https://www.khronos.org/registry/
To keep things simpler Khronos maintains the khrplatform header to be used by other headers maintained by Khronos, defining common data types, tokens and calling convention macros. However:
Adopters may modify this file to suit their platform. Adopters are encouraged to submit platform specific modifications to the Khronos group so that they can be included in future versions of this file. Please submit changes by filing pull requests or issues on the EGL Registry repository linked above.
Ironically, this makes it a little more complex to integrate since there may be many APIs and vendors (or "adopters") within the same system. How would these modifications be merged? How to make multiple headers co-exist within the same system? What if some vendor relies on the header looking EXACTLY like the original spec? For that reason providing an option to NOT depend on the khrplatform header makes sense. Wouldn't you agree?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With