A modern game engine built with Vulkan and C++20, featuring cross-platform support via MoltenVK on macOS.
- Vulkan Renderer: Modern graphics API with MoltenVK support for macOS
- GLFW Integration: Cross-platform window and input management
- Layer-based Architecture: Modular application structure with layer system
- C++20: Modern C++ features and best practices
- CMake Build System: Cross-platform build configuration with presets
- Visual Studio 2022 (or Build Tools for Visual Studio 2022) with C++ workload
- CMake (3.21+): Install via cmake.org or
winget install Kitware.CMake - Ninja:
winget install Ninja-build.Ninja(or include via Visual Studio) - LLVM/Clang (optional, for clang presets):
winget install LLVM.LLVM - Vulkan SDK: Download from LunarG
- Run the installer and ensure "Shader Toolchain Debug Symbols" is selected
- The installer automatically sets
VULKAN_SDKenvironment variable
- Xcode Command Line Tools:
xcode-select --install - CMake (3.21+):
brew install cmake - Ninja:
brew install ninja - Vulkan SDK: Download from LunarG
- Install the macOS SDK (includes MoltenVK)
- Current tested version: 1.4.328.1
The Vulkan SDK installer automatically configures the required environment variables. Verify by opening a new terminal and running:
echo $env:VULKAN_SDKIf using Clang, ensure it's in your PATH:
clang --versionAdd the following to your ~/.zshrc (or ~/.bashrc for Bash):
export VULKAN_SDK="$HOME/VulkanSDK/1.4.328.1/macOS"
export PATH="$VULKAN_SDK/bin:$PATH"
export DYLD_LIBRARY_PATH="$VULKAN_SDK/lib:$DYLD_LIBRARY_PATH"
export VK_ICD_FILENAMES="$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json"
export VK_LAYER_PATH="$VULKAN_SDK/share/vulkan/explicit_layer.d"After editing, reload your shell configuration:
source ~/.zshrc # or source ~/.bashrcUse the Clang preset (requires LLVM/Clang installed):
# Configure (Debug)
cmake --preset clang-debug
# Build
cmake --build build/clang-debug
# Or for Release builds
cmake --preset clang-release
cmake --build build/clang-releaseThe executable will be created at build/clang-debug/application/khclone.exe.
The project includes macOS-specific build presets that use the system AppleClang compiler:
# Configure (Debug)
cmake --preset macos-debug
# Build
cmake --build build/macos-debug
# Or for Release builds
cmake --preset macos-release
cmake --build build/macos-releaseThe executable will be created at build/macos-debug/application/khclone.
On macOS, if you prefer to use a different clang installation:
cmake --preset clang-debug
cmake --build build/clang-debugAfter building, run the application:
Windows:
.\build\clang-debug\application\khclone.exemacOS:
./build/macos-debug/application/khcloneYou should see output similar to:
[Momo] Starting 'KHClone' (1920x1080)
[VulkanRenderer] Creating Vulkan instance...
[AppLayer] Attached to application.
- Graphics API: Vulkan 1.3+ (via MoltenVK on macOS)
- Windowing: GLFW 3.4
- Language: C++20
- Build System: CMake 3.21+ with Ninja generator
- Platforms: Windows 10/11, macOS (Apple Silicon and Intel)
The engine uses a layer-based architecture. To create a new layer:
class MyLayer : public Momo::Layer
{
public:
void OnAttach() override
{
// Initialize layer resources
}
void OnUpdate(float dt) override
{
// Update logic
}
};
// In main.cpp
app.PushLayer<MyLayer>();Available presets:
macos-debug: macOS with system AppleClang (Debug)macos-release: macOS with system AppleClang (Release)clang-debug: Generic Clang (Debug)clang-release: Generic Clang (Release)
The project is configured with strict compiler warnings:
- GCC/Clang:
-Wall -Wextra -Wpedantic - MSVC:
/W4 /permissive-
MoltenVK is a Vulkan Portability implementation that translates Vulkan calls to Metal on Apple platforms. The engine properly configures:
VK_KHR_portability_enumerationextensionVK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHRflag- MoltenVK ICD (Installable Client Driver) detection
These are handled automatically by the engine's Vulkan initialization code.
- Ensure LLVM is installed:
winget install LLVM.LLVM - Add LLVM to PATH (usually
C:\Program Files\LLVM\bin) - Open a new terminal after installation
- Ensure Vulkan SDK is installed with validation layers
- Check
VULKAN_SDKenvironment variable is set - Try running from Developer Command Prompt for VS 2022
If you see this error, ensure:
- Vulkan SDK is properly installed
- Environment variables are set correctly (see Environment Setup)
- You've reloaded your shell configuration or opened a new terminal
Use the macos-debug or macos-release presets instead of clang-debug/clang-release to use the system AppleClang compiler.
Ensure GLFW is being built with Vulkan support. The engine automatically fetches and builds GLFW with the correct configuration.
[Add your license information here]
[Add contribution guidelines here]