This template will help you follow the lessons from this OpenGL class.
It works on all platforms (Windows, Linux, MacOS).
First, create your own repository based on this one. If you are using GitHub you can use this repository as a template:
Otherwise simply create a repository on your own and copy-paste all the files in this repo to your new repo.
NB: you might also want to change or remove the LICENSE file. Your project does not need to use the same license as the one we use for this template.
Run this command inside the directory where you want to put this project:
git clone your_repo_url
If that is not already done, install a compiler.
If that is not already done, setup your IDE for C++ development.
Once that is done, open the project folder in your IDE: it will detect the CMakeLists.txt file automatically and you can just run the project:
You should see this:
All your files for the current exercise will go in the folder with the same name (e.g. TP1_exo1_triangle_blanc
). All the files that you want to reuse in all the exercises will go in src-common
. All of your assets (textures, 3D models, etc.) will go in the assets
folder.
To switch between the different exercises, simply change the current CMake target: NB: If you don't see this, you need to enable it in your Settings (CTRL+,): Set "Cmake Status Bar Visibility" to Compact or Visible:
If you want to add a new folder to code in it, simply copy-paste one of the existing exercise folders, rename it however you want, and add it to the bottom of the CMakeLists.txt
:
add_exercise(TP1_exo1_triangle_blanc)
add_exercise(TP1_exo2)
add_exercise(TP2_exo1)
add_exercise(TP2_exo2)
add_exercise(TP2_exo3)
# ...