Simple game engine in C++.
-
Clone repository and install engine dependencies.
git clone https://github.com/Bleskocvok/frog-engine.git cd frog-engine sh ./script/libraries.sh
Folder
game
contains an example 3D game and foldergame2d
contains a sample of 2D game code.
-
The build might need additional system packages installed:
libgl1-mesa-dev
,mesa-common-dev
,libxrandr-dev
,libxinerama-dev
,libxcursor-dev
andlibxi-dev
should cover it. These will be probably in your package manager's repository. -
It can be build by using the helper
build
script.sh ./script/build -o bin-game -b Release gen-build game
-
Or by manually invoking
cmake
commands.cmake -S game -B bin-game cmake --build bin-game -j4
-
To run the compiled example, execute the
Game
binary../bin-game/Game
-
It can be build by using the helper
build
script.sh ./script/build -o bin-game2d -b Release gen-build game2d
-
Or by manually invoking
cmake
commands.cmake -S game2d -B bin-game2d cmake --build bin-game2d -j4
-
To run the compiled example, execute the
Game
binary../bin-game2d/game_2d
-
./engine/
the whole engine -
./engine/src/
the engine source files -
./engine/tests/
tests for linear algebra calculations -
./engine/docs/
generated documentation using Doxygen, see./engine/docs/html/index.html
-
./engine/libraries/
contains a folder for each additional library used by the engineGLFW/
(https://www.glfw.org/)glad/
(https://glad.dav1d.de/)stb_image/
(https://github.com/nothings/stb/blob/master/stb_image.h)tiny_obj_loader/
(https://github.com/tinyobjloader/tinyobjloader)doctest/
(https://github.com/doctest/doctest)
./engine/assets/
the engine assets such as shaders and font atlas
-
./src/
source files of the game -
./game_assets/
textures used in the game -
./bin-win/Game.exe
and./bin-lin/Game
the resulting compiled game for Windows and Linux respectively -
./out/build/x64-Debug/Debug/Game.exe
the resulting compiled game for Windows when compiled in Visual Studio
-
The engine is wrapped in the namespace
frog
and individual components are separated into nested namespaces:frog
- core engine partfrog::geo
- geometry & maths: matrix, vector, etc.frog::gl
- graphics stuff: rendering, mesh, mesh generationfrog::os
- system stuff: window creation, events handling
-
Font in
./engine/assets/font.png
is based off of my own font from this repository -
The architecture used for the engine is inspired by Unity:
- the engine follows this structure:
engine
->scene_manager
->scene
->game_object
->script
- the engine follows this structure:
-
It should just work in VS 2019 (the C++ VS components need to be installed in VS Installer)
-
Make sure to select the desired target (
Game.exe
orgame_2d.exe
)
-
Install necessary tools:
cmake
,mingw64
-
In
PowerShell
, enter the root folder of the project; If you perform thels
command, you should see files such asCMakeLists.txt
,README.md
,engine/
, ... -
Make sure the folder
bin-win
is empty -
Call
script/build.bat
-
Pray that it works; if not, return to step 1. and try to reconfigure the installation of
cmake
ormingw
-
If it worked, after it has finished you should be able to open
bin-win/Game.exe
, which starts the game
Originally made as a project assignment.
Link to the original repository pa199-project