- Support macOS (ARM64, x86_64) with Clang or GCC compiler
- Maybe support Windows (x86_64) with MinGW-w64 compiler (but not tested)
This is the structure of the project.
.
├─.vscode
├─external
│ ├─freetype
│ │ ├─include
│ │ ├─lib-darwin-arm64
│ │ ├─lib-darwin-universal
│ │ ├─lib-darwin-x86_64
│ │ └─lib-windows-x86_64
│ ├─glad
│ │ ├─include
│ │ └─src
│ ├─glfw
│ │ ├─include
│ │ ├─lib-darwin-arm64
│ │ ├─lib-darwin-universal
│ │ ├─lib-darwin-x86_64
│ │ └─lib-windows-x86_64
│ ├─glm
│ │ └─glm
│ └─stb
├─.gitignore
├─C1-RotatingTriangle-OpenGL
├─C2-TriAndQuad-OpenGL
├─C4-QuadTexture-OpenGL
├─B3-DisplayModel-OpenGL
├─B4-InteractAndLight-OpenGL
├─B7-QEMSurfaceSimplify-OpenGL
├─A4-LoopSurfaceSubdivision-OpenGL
├─A6-TerrainEngine-OpenGL
└─README.md
You need to install CMake and a suitable compiler to develop this project. For the compiler,
- Windows: MinGW-w64 GCC. You can follow this tutorial: Get Started with C++ and MinGW-w64 in Visual Studio Code.
- macOS: Clang. You can follow this tutorial: Configure VS Code for Clang/LLVM on macOS
The generated executable will be placed at build/bin
.
If you have problems configuring the project, you can try to delete the build
directory and re-run the above commands.
Each task (A, B, or C) is organized into its own directory. To compile and run a specific task, follow these steps:
-
Navigate to the task directory: For example, if you are working on the
A3
task, use the following command:cd C1-RotatingTriangle-OpenGL
-
Create the
build
directory and navigate into it:mkdir build cd build
-
Run CMake to configure the project:
cmake ..
-
Build the project using
make
:make
-
Run the executable: The generated executable will be located in the
build/bin
directory. Run it with:./bin/project_name
Replace project_name
with the actual name of the executable generated for that task.
Some projects support running with parameters. Please refer to the main.cpp code for configuration.
You will always need to run the program from your terminal rather than double clicking. Otherwise, the program will get a wrong working directory.
Please note that Mac OS only support OpenGL<=4.1
.