A modular graphics engine built using C++17 and Vulkan 🚀
The purpose of this graphics engine is to simplify the process of working with Vulkan by abstracting away the tedious work needed to setup both on and off-screen rendering. It is also a learning exercise for me to understand how graphics engines work and how to make my very own.
The repository relies on submodules to work correctly, so you can simply type the following to clone the repo and all submodules:
# clone repo and all submodules
git clone --recursive https://github.com/chapmankyle/carbon-engine.git
If you would like to update the repository, it is advised to update the submodules as well by typing the following:
# pull recent changes
git pull
# update submodules
git submodule update --init --recursive
The engine is packaged as a header-only library, making installation easy.
Simply copy the source folder to your build tree and use a C++17 compiler.
That's it, enjoy! 🎉
To create the most basic window, all you need is the following:
#include "carbon/carbon.hpp"
int main() {
// create default engine
carbon::Engine engine();
// main loop when window is open
while (engine.isRunning()) {
engine.update();
}
return 0;
}
The above code will create a resizable 800 x 600
window with the title "Application".
To create a window with a title, width, height, etc., you need the following:
#include "carbon/carbon.hpp"
int main() {
// setup properties for the engine window
carbon::window::Props properties;
properties.title = "Game Title Goes Here";
properties.width = 1280;
properties.height = 720;
properties.resizable = true;
// create engine with specified properties
carbon::Engine engine(properties);
// main loop when window is open
while (engine.isRunning()) {
engine.update();
}
return 0;
}
The above code will create a resizable 1280 x 720
window with the title "Game Title Goes Here".
To disable debug messages, make sure to define the following flag:
#define CARBON_DISABLE_DEBUG
#include "carbon/carbon.hpp"
The macro needs to be before the include of carbon
, otherwise the debug messages will be present.
The following dependencies are included as submodules in the deps
directory:
- 📺 glfw - Used for handling window interaction
- 📐 glm - Used for working with vectors and matrices
- 📄 spdlog - Used for logging engine information
carbon common
carbon core
carbon display
carbon engine
carbon pipeline
carbon resources
This engine is in a very early alpha stage, so any criticism or ideas are welcome! Simply open a pull request with details of the changes and I'll review it!
The master
branch is for the stable releases and the dev
branch is for the newest features, which may
make the engine unstable.