3Engine
Game Engine 3Engine using OpenGL made for a class on Computer Graphics for Games.
Fun feature: uses JSON files for configuration with realtime change detection.
This project depends on OpenGL, GLEW and SDL2. While the first is normally installed by default in most systems the latter libraries are not.
You might want to visit the Release page and check out pre-built versions of the engine.
CONTRIBUTIONS: Help make the library more usable. Mainly regarding using pre-built versions.
How to Build in Linux?
Setup
To add all the necessary dependencies you need to run the Setup.sh
file. It will install some dependencies on Ubuntu/Debian Oses and download and prepare GLEW and SDL2 libraries.
./Setup.sh
Non-Ubuntu OSes Dependencies
If you don’t use a Ubuntu/Debian OS, please install the following dependencies.
- g++
- libxmu-dev
- libxi-dev
- cmake
- libgl1-mesa-dev
- libjpeg-dev
- libtiff-dev
- libwebp-dev
- libfreetype6-dev
Compiling
In Linux, we created a CMake project and currently use CLion IDE. To open a project open the CMakeLists.txt
file with CLion.
You can use any other IDE that supports CMake (CodeLite, Kdevelop, etc.).
If you wish to compile it using the terminal follow this steps:
cd project-folder
mkdir -p intermediate
cd intermediate
cmake .. -DCMAKE_BUILD_TYPE=Debug
make LightScene # This is a specific example scene using BRDF
The JSON config files are copied from config
folder to a same named folder on the build folder.
Run
Either press Play in Clion or using the terminal follow these steps:
cd bin/debug/
./LightScene
AppImage (Testing)
An AppImage allows me to build an executable and distribute it more easily. Therefore you may see Releases using AppImage. If you wish to compile the Engine into an AppImage follow the compiling steps, but replace the last one with make AppImage
:
cd project-folder
mkdir -p intermediate
cd intermediate
cmake .. -DCMAKE_BUILD_TYPE=Debug
make AppImage
To run in just double-click on the 3Engine.AppImage
file in the bin/AppImage
folder.
How to Build in Windows?
Dependencies
The inclusion of the said libraries are needed, yet dependencies are ignored to reduce the size of the project. To get the project to run follow the steps.
-
Download precompiled builds for MSVC (or compile it yourself)
-
Create a folder named
dependencies
and place inside the libraries. Rename them as shown:- SDL2
- SDL2-image
- GLEW
Compiling
As in Linux, we make use of CMake to compile the code. We use the Visual Studio compiler. We recommend Visual Studio 2017 Community edition. To open the project just open the base project folder with Visual Studio or the CMakeLists.txt
with Clion (if you use Clion you still need to have VS installed).
Set the configuration to Debug
or Release
, and the platform to x64
. Then just press Play to run.
The default build folder is in ‘bin’ folder. .dll
files from SDL2 and GLEW are copied to the build folder (along with other needed files).
Run
Either press Play in Visual Studio or double-click the compiled executable in the bin
folder.
How to Run in Mac OS X?
Dependencies
The inclusion of the said libraries are needed, yet dependencies are ignored to reduce the size of the project. To get the project to run follow the steps.
-
Following similar steps, install SDL-image Development Libraries.
-
Using Homebrew, install GLEW:
brew install glew
Compiling
Follow the Linux instructions.
Run
Follow the Linux instructions.