Getting glad
You can get glad
from https://glad.dav1d.de/, a web-based generator:
- Go to the site, select Version 3.3 from the gl dropdown, and select Core from the Profile dropdown:
- Scroll to the bottom and hit the Generate button. This should start downloading a ZIP file that contains all of the required code.
The code presented in this book is forward compatible with OpenGL version 3.3 or a more recent version. If you want to use a newer OpenGL version, such as 4.6, change the gl dropdown under API to the desired version. You will be adding the contents of this ZIP file to your main project in the next section.
Adding glad to the project
Once glad.zip
is downloaded, extract its contents. Add the following files from the ZIP file to your project. The directory structure does not need to be maintained; all of these files can be placed next to each other:
src/glad.c
include/glad/glad.h
include/KHR/khrplatform.h
...