ZEngine
THE SINGLE-HEADER C/C++ 2D VULKAN ENGINE using RGFW, miniaudio, stb_image & stb_trutype for Linux, Windows and (beta) Mac
Install / Use
/learn @ZDev22/ZEngineREADME

THE SINGLE-HEADER C/C++ 2D VULKAN ENGINE
About:
My goal for this engine is to be THE FASTEST 2D game engine, aiming for thousands of FPS on lower-end devices, as well as utilizing GPU accelerated graphics with Vulkan and SPIR-V shaders.
It has features like sprite creation and texture loading and (beta) font rendering that all run REALTIME, as well as the ZDep modules which are lightweight and super usefull for creating 2D games!
Use ffmpeg to convert any .wav into .mp3 files. Also use ffmpeg to compress them:<\br> ffmpeg -i input.mp3 -c:a libmp3lame -q:a 9 output.mp3
Version handling is ZIVH (ZDev's Incremental Version Handling) - a non-destructive version counting system ex: 1.4.7 -> 2.4.7 9.12.9.4 -> 9.13.9.4 and does none of this nonsense: 1.8.0 -> 1.8.5
Licensed under the GNU GPL v3 license - please see https://github.com/ZDev22/ZEngine/blob/main/LICENSE for more details
If you find an issue, please submit an issue on the github page. If you also find a fix, make it a pull request!
Clone the repo:
git clone --depth=1 https://github.com/ZDev22/ZEngine
cd ZEngine
Dependencies:
LINUX:
Arch:
sudo pacman -Syu --noconfirm
sudo pacman -S gcc cmake gdb --noconfirm #C/C++/Cmake/Cdbg
sudo pacman -S libx11 libxrandr libxcursor xkbcommon mesa --noconfirm #X11
sudo pacman -S vulkan-headers vulkan-tools vulkan-icd-loader --noconfirm #Vulkan
# Intel GPU: sudo pacman -S vulkan-intel --noconfirm
# AMD GPU: sudo pacman -S vulkan-radeon --noconfirm
Debian:
sudo apt update
sudo apt install build-essential cmake gdb -y #C/C++/Cmake/Cdbg
sudo apt install libx11-dev libxrandr-dev libxkbcommon-dev libegl1-mesa-dev libxcursor-dev libxi-dev -y #X11
sudo apt install libvulkan-dev libvulkan1 mesa-vulkan-drivers vulkan-tools -y #Vulkan
Fedora:
sudo dnf update -y
sudo dnf install gcc gcc-c++ cmake gdb -y #C/C++/CMake/Cdbg
sudo dnf install libX11-devel libXrandr-devel libxkbcommon-devel mesa-libEGL-devel libXi-devel libXcursor-devel -y #X11
sudo dnf install vulkan-headers vulkan-tools vulkan-loader-devel -y #Vulkan
# Intel GPU: sudo dnf install vulkan-intel -y
# AMD GPU: sudo dnf install vulkan-radeon -y
Gentoo:
root # emerge --sync
sudo emerge --ask sys-devel/gcc sys-devel/cmake sys-devel/gdb -y #C/C++/CMake/Cdbg
sudo emerge --ask x11-libs/libX11 x11-libs/libXrandr x11-libs/libXi x11-libs/libXcursor x11-libs/libxkbcommon mesa-libs/mesa -y #X11
sudo emerge --ask media-libs/vulkan-loader dev-util/vulkan-headers media-libs/vulkan-tools -y #Vulkan
# Intel GPU: sudo emerge --ask media-libs/vulkan-intel
# AMD GPU: sudo emerge --ask media-libs/vulkan-radeon
Leap:
sudo zypper refresh
sudo zypper update -y
sudo zypper install -t pattern devel_C_C++ cmake gdb -y #C/C++/CMake/Cdbg
sudo zypper install libX11-devel libXrandr-devel libxkbcommon-devel Mesa-libEGL-devel libXi-devel libXcursor-devel -y #X11
sudo zypper install vulkan-headers vulkan-loader-devel vulkan-tools -y #Vulkan
# Intel GPU: sudo zypper install vulkan-intel -y
# AMD GPU: sudo zypper install vulkan-radeon -y
Alpine:
sudo apk update
sudo apk add build-base cmake gdb #C/C++/CMake/Cdbg
sudo apk add libx11-dev libxrandr-dev libxkbcommon-dev libxi-dev libxcursor-dev mesa-egl-dev #X11
sudo apk add vulkan-headers vulkan-tools vulkan-loader-dev #Vulkan
# Intel GPU: sudo apk add vulkan-intel
# AMD GPU: sudo apk add vulkan-radeon
MAC (beta):
- Install XCode from the app store
- Install the lldb extension
brew install gcc cmake lld #C/C++/Cmake/Cppdbg
brew install vulkan-tools vulkan-headers molten-vk #Vulkan
WINDOWS:
- Download the Windows Installer from https://cmake.org/download/
- Download vulkan from: https://vulkan.lunarg.com/sdk/home
- Download msys2 from https://www.msys2.org/ CLOSE THE TERMINAL
- Launch MSYS2 MSYS (the purple one)
- Run the following commands to download a C++ compiler:
pacman -Syu
pacman -S base-devel mingw-w64-x86_64-toolchain
- In the windows search bar, look up "Edit environment variables"
- Add C:\msys64\ucrt64\bin to your user (or system) PATH
- Add C:\msys64\mingw64\bin to your user (or system) PATH
- Restart your IDE (or terminal)
Extensions (Linux/Windows):
- Install @category:debuggers cppdbg or ms-vscode.cpptools to run the program in VSCode
- Install the cppdbg extension to run the program in VSCodium
How do make your own games:
- Duplicate flappybird.hpp as a good base for your game
- Delete the tick() implementation and replace it with your own
- In main.cpp make sure to include your game instead of the example
- ZDeps documentation is inside their respective files
Included dependencies:
VULKAN (Graphics)</br> RGFW (Window)</br> MINIAUDIO (Audio) {Modified}</br> STB-IMAGE (Image loader) {Modified}</br> STB-TRUETYPE (font text rasterizer) {Modified}
Build commands:
Linux:
cmake --preset linuxrelease
cmake --build --preset linuxrelease -j4
Mac:
cmake --preset macrelease
cmake --build --preset macrelease -j4
Windows:
cmake --preset windowsrelease
cmake --build --preset windowsrelease -j4
Availiable presets:
linuxdebug linuxrelease linuxsmol
macdebug macrelease macsmol
windowsdebug windowsrelease windowssmol
Run your games:
Linux:
cd build/linux/Release
./main
Mac:
cd build/mac/Release
./main
Windows:
cd build\windows\Release
.\main
Related Skills
node-connect
350.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
350.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
