/IMACS4-SI

Primary LanguageC++Creative Commons Zero v1.0 UniversalCC0-1.0

OpenGL TPs Template

This template will help you follow the lessons from this OpenGL class.

It works on all platforms (Windows, Linux, MacOS).

Setting up

Creating a repository

First, create your own repository based on this one. If you are using GitHub you can use this repository as a template:

image

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.

Downloading your repository

Run this command inside the directory where you want to put this project:

git clone your_repo_url

Compiling

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: image

You should see this:

initial-window

Coding

Folder structure

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.

Switching exercise

To switch between the different exercises, simply change the current CMake target: Change 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: image

Adding an exercise folder

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)
# ...