TJE Framework is a C++ layer on top of SDL and OpenGL to help create games or visual applications. It only provides the basic GPU abstraction (Meshes, Textures, Shaders, Application). It has been used for many years in the Videogame's development courses at the Universitat Pompeu Fabra.
It contains the basics to do something nice:
- Mesh, Texture, Shader and FBO classes
- Vector2,Vector3,Vector4,Matrix44 and Quaternion classes
- Meshes have a ray-mesh and sphere-mesh collision method (thanks to library Coldet)
- Parser to load OBJ, PNG and TGA. Re-stores meshes in binary for faster load.
- Supports skinned animated meshes using own format (you must use a web tool to convert them).
Clone and initialize the repository:
git clone --recurse-submodules -j8 https://github.com/upf-gti/TJE_Framework.git
The framework provided is compatible with all operating systems. The steps for each platform are mandatory to be able to build the framework. The mandatory C++ IDEs are the following:
- MS Visual Studio Community (Windows)
- XCode (Mac)
- Visual Studio Code (Linux, optional for other platforms)
Detailed installation information can be seen below.
MS Visual Studio Community can be downloaded from here. Make sure you select "Desktop Development with C++".
In addition you need to install CMake which can be downloaded from here. Select "Windows x64 Installer" for the last version. Remember to set "Add CMake to PATH" when asked while installing, otherwhise you won't be able to call CMake from the terminal.
Once you have all required open a Windows Terminal, go to the project folder and do this steps:
mkdir build
cd build
cmake ..
This will generate a Visual Studio project inside the folder build/
(.sln) that you can use to compile and debug the framework.
You need XCode installed in your system (you may need to update MacOS version), Homebrew to install the missing libraries and also CMake.
To install Homebrew open a terminal and run this command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Continue by installing cmake using this command:
brew install cmake
Once you have all required open a MacOS Terminal, go to the project folder and do this steps:
mkdir build && cd build
cmake -G "Xcode" ..
This will generate a XCode project inside the folder build/
that you can use to compile and debug the framework.
If this process leads to cmake errors, run this command an try again:
sudo xcode-select --reset
Install cmake and needed libraries using this command:
sudo apt install cmake
sudo apt install build-essential
sudo apt install -y libglu1-mesa-dev freeglut3-dev mesa-common-dev libgl1-mesa-dev
Once you have all required open a Linux Terminal, go to the project folder and do this steps:
mkdir build && cd build
cmake ..
This will generate a Makefile inside the folder build/
that you can use to compile framework.
Use make
to compile. You can speed-up compilation using more threads with -j(num threads)
, for example: make -j8
.
After installing all the libs for your platform, if you need a more light weight IDEs which can be used in any platform (included Linux), this is your better option.
Visual Studio Code can be downloaded for each platform here.
After the VSCode and the requirements for each platform are installed (the steps for each platform are mandatory!), the following extensions are needed to work with C++ code:
C/C++
C/C++ Extension Pack
C/C++ Themes
Cmake Tools
Check this link to learn how to debug the framework in Visual Studio Code.
First, open the project folder where the CMakeLists.txt is located, then open the CMake tab on the left, configure and build the project.