This project is a tiny graphics framework used by the Computer Graphics Department of the Polytechnic University of Bucharest. It is currently used as teaching and study material for a number of courses of increasing complexity, including, but not limited to:
EGC
Elements of Computer Graphics, BSc year 3 — course materials (RO)SPG
Graphics Processing Systems, BSc year 4 — course materials (RO)
The functionality is split into several modules of increasing difficulty (m1
, m2
, etc.).
You can read more about it in the docs.
It has missing and closed-source functionality that you will need to implement.
The code is cross-platform, and supports the following architectures:
- Windows:
i686
,x86_64
,arm64
- Linux:
i686
,x86_64
,arm64
- macOS:
x86_64
,arm64
This section describes what you need to do and install before actually building the code.
The compiler requirements are listed below. We strongly recommend to always use the latest compiler versions.
-
Minimum:
- Windows: Visual Studio 2015 Update 3 with
Programming Languages -> Visual C++
checked when installing - Linux:
g++
version 5 - macOS:
clang++
version 4
- Windows: Visual Studio 2015 Update 3 with
-
Recommended:
- Windows: Visual Studio 2019 with
Workloads -> Desktop development with C++
checked when installing - Linux:
g++
latest - macOS:
clang++
latest, by doing one of the following:- for LLVM/Clang: install
brew
then runbrew install llvm
- for Apple Clang: install XCode
- for LLVM/Clang: install
- Windows: Visual Studio 2019 with
Graphics capabilities are decided by the combination of your computer's hardware, drivers, and operating system.
This project requires OpenGL version 3.3 core profile, or newer for the simpler parts, and version 4.3 core profile, or newer for the more advanced parts. If you have a computer manufactured within the last few years, you should be safe. If you're not sure, follow the steps in this guide to find out.
There are some open-source libraries that this project uses. To install them:
-
Windows: you don't need to do anything - all necessary libraries are already provided with the code
-
Linux: depending on your distribution, run one of the following scripts as superuser:
- Debian (Ubuntu):
./tools/deps-ubuntu.sh
- Red Hat (Fedora):
./tools/deps-fedora.sh
- Arch (x86_64):
./tools/deps-arch.sh
- Debian (Ubuntu):
-
macOS: install
brew
then run./tools/deps-macos.sh
This project uses CMake. It a nutshell, CMake does not compile source code, instead it creates files that you then use to compile your code (for example, it creates a Makefile on Linux and macOS, a Visual Studio project on Windows, and so on).
This project requires CMake 3.16 or newer, however, as with the compilers, we strongly recommend that you use the latest version. To install it, follow these steps:
-
Windows:
- go to the CMake downloads page
- download the latest version of the file called
cmake-<VERSION>-windows-x86_64.msi
- install it
-
Linux:
- use your package manager to install
cmake
- check the version using
cmake --version
- depending on the version:
- if it's the minimum required (see above), you're all set
- otherwise, run
./tools/install-cmake.sh && . ~/.profile
in a terminal
- use your package manager to install
-
macOS:
- run
brew install cmake
- run
After installation, run cmake --version
(again) to check that it's in your PATH
environment variable. This should happen automatically, but if it didn't, just add it manually. Instructions on how to add an executable to your PATH
differ across operating systems and are not covered here.
Open a terminal and go into the root folder of the project, which contains the top-level CMakeLists.txt
file.
Do not run CMake directly from the top-level folder (meaning, do not do this: cmake .
). Instead, make a separate directory, as follows:
mkdir build
cd build
- Generate the project:
- for module 1 labs (default):
cmake ..
- for module 2 labs:
cmake .. -DWITH_LAB_M1=0 -DWITH_LAB_M2=1
- for extra labs:
cmake .. -DWITH_LAB_M1=0 -DWITH_LAB_EXTRA=1
- for none (
SimpleScene
only):cmake .. -DWITH_LAB_M1=0
- for module 1 labs (default):
- Build the project:
- Windows, one of the following:
cmake --build .
- or just double-click the
.sln
file to open it in Visual Studio, then pressCtrl+Shift+B
to build it
- Linux and macOS, one of the following:
cmake --build .
- or just
make
- Windows, one of the following:
That's it! 🎉
It's very simple to rebuild:
- Every time you modify source code and want to recompile, you only need to follow the last step (for example, just
make
again) - Every time you add/remove/rename a source code file on disk, you need to follow the last two steps (for example, just
cmake .. && make
again) - If something goes wrong when generating the project, just delete the contents of the
build
folder, or the folder itself, then follow all the steps again
You can run the project from an IDE, as well as standalone, from anywhere on disk. For example:
-
Windows, one of the following:
.\bin\Debug\GFXFramework
- or just open the
.sln
file in Visual Studio, then pressF5
to run it
-
Linux and macOS:
./bin/Debug/GFXFramework
To run a certain lab:
- Go into
main.cpp
- Find this line:
World *world = new gfxc::SimpleScene();
- Replace it with whatever you want to run, for example:
World *world = new m1::Lab1(); World *world = new m2::Lab1(); World *world = new extra::TessellationShader(); // etc.
All user and developer documentation can be found in the docs
directory.
See the CONTRIBUTING.md file for more info. A future roadmap is TBD.
This project is available under the MIT license; see LICENSE.md for the full license text. This project also includes external libraries that are available under a variety of licenses; see LEGAL.txt for the full license texts and legal notices.