material
software download
glfw 3.3.8
The purpose of downloading glfw:
- Get the include in the compressed package
- Generate glfw3.lib
get include
Unzip and find Include, include contains the GLFW folder
Generate glfw3.lib
- Use CMake to generate GLFW project files
- Find the file with the suffix sln in the generated directory, double-click to open it
- Select x64, right click on the solution, generate a solution
- There are generated files in the generated directory src/Debug, glfw3.lib
glad 3.3
- Download and unzip to get folders: src、 Include
- scr contains the glad.c file
- Include folder contains glad and KHR folders
folder organization
Create a new folder with the following structure
- Link/Include stores glad, KHR, GLFW
- Link/Lib store glfw3.lib
- Link/src stores glad.c
IDE link file
- Use to create a new C++ empty project, set it to x64, select project/properties
- Add the include directory to the VC++ directory, and the path where Link/Include is located
- Add the library directory to the VC++ directory, the path where Link/Lib is located
- linker/input/additional dependencies add opengl32.lib and glfw3.lib
- Select Project/Add/Existing Item Add Glad.c in Link/scr
test
- Create a new file cpp file
- Copy the code to the cpp file and test the code
- A window appears when running, indicating that the configuration is successful, as shown in the figure below