Copyright (c) 2019 Seth Traman as GPLv3.
Gengine is a software framework for making cross-platform video games in the C++ language. It's named after "Game Engine".
This project is proud of the following features:
- Adaptive GPU backend uses either Vulkan or WebGL/ES.
- Automated the software lifecycle using CI/CD pipelines
- Performant virtual worlds powered by Bullet³ physics
- Supported platforms are desktop Linux and the Web.
Try it online using a web browser.
Download for x64 Linux using the instructions below.
- Download the .zip
- Extract (
unzip linux-vk-app.zip
). - Run (
./bin/world.native.bin
) to play.
Other platforms aren't supported yet.
Download the project using git.
git clone https://github.com/stickyfingies/gengine.git
git submodule init
git submodule update
In the next step, setup.sh
automatically configures your developer environment and fetches the dependencies that we use.
Note:
setup.sh
may run for several minutes.
chmod +x setup.sh
./setup.sh
Now, we can use CMake to build the application for your desired platform.
cmake --workflow --preset linux-vk-app # for linux
cmake --workflow --preset web-gl-app # for web
And you're done! Run it on Linux like this:
./artifacts/linux-vk-app/gengine
And you're done! Run it on Web like this:
cd ./artifacts/web-gl-app
python3 -m http.server
# Game running: '0.0.0.0:8000/gengine.html'
Compilation Strategy:
flowchart LR
subgraph GPU[GPU Library]
direction BT
gpu.h[GPU Interface]
gpu.vk.cpp[Vulkan Backend]
gpu.gl.cpp[OpenGL Backend]
gpu.webgl.cpp[WebGL Backend]
gpu.h -->|Platform Detect| gpu.vk.cpp
gpu.h -->|Platform Detect| gpu.gl.cpp
gpu.gl.cpp -->|Emscripten| gpu.webgl.cpp
end
subgraph World[World Library]
world.native.cpp[Game A]
world.wasm.cpp[Simulation X]
end
subgraph Engine[Engine Library]
direction LR
assets.cpp[Asset Processing]
physics.cpp[Physics Simulation]
glfw.h[Window Management]
end
Engine <-->|Static Link| World <-->|Static Link| GPU
Loading Objects from Asset Files:
Note: the figure below may be outdated.
flowchart TB
Asset --> Matrix & Geometry & Texture
Geometry --> Collidable & Renderable
Texture --> Descriptor[Material]
Matrix --> Collidable
Collidable & Renderable & Descriptor --> GameObject
Gengine uses the Asset Importer Library to pull geometry and texture data from static asset files.
The geometry is passed into the physics engine to create a physically simulable representation of that shape.
The geometry and the texture are passed into the rendering engine to create a structure that can be rendered on the GPU.
Finally, the culmination of these are used to create a cohesive "game object" that is both visible and tangible.
C++
- Modern C++ DevOps
- DevLog - Molecule Game Engine
- DevLog - Autodesk Stingray / BitSquid Engine
- DevLog - Our Machinery Engine
Rendering
- Learn OpenGL Start here — this tutorial taught me C++. It's that good.
- Vulkan Tutorial
- Vulkan Guide - Resources
- Writing an efficient Vulkan renderer
- Interleaved or Separate Vertex Buffers
All software dependencies are installed and managed by vcpkg.
- glfw3: cross-platform window creation and input
- bullet3: physics simulation for video games
- assimp: load and parse various 3d file formats
- glm: mathematics library for graphics software
- stb: image loading & decoding from files and memory
- imgui: bloat-free graphical user interface for C++
- Resizable windows
- Colors and Textures
- Texture mip-mapping
- Integrate a GUI
- Lighting
- Edit, save, and load scenes
- Benchmarks and performance stats
Copyright (c) 2019 Seth Traman.
GPLv3. See COPYING.