Small C++20/DirectX 11 game engine playground with a shared core and multiple playable mini-games/demos running on top of one application runtime.
Russian version: README_RU.md
- Overview
- Games and Demos
- Current Features
- Project Architecture
- Controls
- Build Requirements
- Build and Run
- Project Structure
Preview (static): large motion captures are kept out of Git to keep the repo small. Use the Katamari screenshots below, or attach a short compressed clip to a GitHub Release for this repository.
The repository started as a Pong project (PingPong) and evolved into a compact game engine framework:
Coreprovides platform/window, app loop, input, rendering, audio, assets, UI, math, and gameplay systems.Game/*contains independent game modules implementing one interface (IGame).main.cppselects which module is launched at runtime.
The executable target is still named PingPong, but it now hosts multiple game modes.
Classic 2D Pong mode with menu flow and match logic:
- Why it exists:
- Baseline "arcade game" module using shared app/runtime APIs
- Fast validation target for input, UI, audio, and 2D rendering changes
- What it provides:
- Player vs Player / Player vs Bot
- Difficulty and match-rule flow
- Main menu, in-game HUD, and game-over screens
- Sound effects + looping music
Interactive 3D solar system sandbox:
- Why it exists:
- 3D simulation-style testbed for cameras, UI controls, and scene updates
- Demonstrates non-combat/non-arcade interaction patterns
- What it provides:
- Orbit and FPS camera modes
- Orbital body rendering and orbit visualization
- Live tuning panel for rotation/orbit parameters
- Movement-driven engine audio feedback
Still frame (avoid ~20MB+ GIFs in the repo; compress locally or host on Releases):
3D rolling-ball mini-game with ECS systems and rendering experiments:
- Why it exists:
- Main advanced 3D gameplay sandbox in this repository
- Stress-tests ECS flow, collisions, rendering modes, and debug passes
- What it provides:
- Roll, absorb, and grow gameplay loop
- Follow camera with smoothing
- Deferred rendering workflow integration
- Particle spawn/settings UI
- Collision debug draw, shadow cascade debug, GBuffer debug
Screenshots:
Compact technical scene used for model/material/lighting/camera validation.
- Why it exists:
- Lightweight visual lab for rendering checks without full gameplay complexity
- What it provides:
- Focused environment for lighting/material/camera sanity checks
Esc- exit application (supported in active game logic)
Switch the active game in main.cpp:
constexpr auto demo = DemoType::Katamari;Available options:
DemoType::Pong
DemoType::SolarSystem
DemoType::Katamari
DemoType::LightingTestF1- FPS cameraF2- Orbit cameraP- projection mode toggleTab- settings panelW,A,S,D- movement / zoom (depending on camera mode)- Arrow keys - look/orbit adjustments
RMB- mouse look/orbit rotation
W,A,S,D- movementSpace- jumpR- level resetF3- collision debug drawF4- shadow cascade debugF5- GBuffer debug visualizationRMB- camera control
The engine is intentionally compact, but already covers a full playable game loop stack:
-
Application Runtime
- Unified game lifecycle through
IGame(Initialize,Update,Render,Shutdown) - Shared runtime context (
AppContext) used by all game modules - One executable, multiple game modules selected at compile-time in
main.cpp
- Unified game lifecycle through
-
Rendering
- 2D + 3D rendering on DirectX 11
- Forward and deferred render modes
- Multi-pass frame pipeline (
Core/Graphics/Rendering/Pipeline) - Directional + point light support, shadow mapping, and debug visualizations
- GBuffer debug mode and shadow cascade debug mode
- GPU particles (integrated into Katamari flow)
-
Gameplay Foundation
- Lightweight ECS-style scene flow (
Scene, entities, components, systems) - Built-in transform, velocity, collision, and render update systems
- 2D and 3D collision helpers
- Reusable camera logic (FPS, orbit, follow camera styles)
- Lightweight ECS-style scene flow (
-
Tooling and Content Runtime
- Asset loading for models and textures (Assimp path)
- Runtime shader files copied into build output automatically
- Built-in UI widgets and debug overlays
- Audio integration via DirectXTK Audio
Application bootstrap and frame loop:
Applicationowns startup/shutdown, timing, update loop, and render loopIGamedefines the contract every game module must implementAppContextexposes platform/window/input/graphics/audio/assets/UI servicesApplicationDefaults.hkeeps default window sizing (1280x720)
Responsibility: this layer is the "host shell" that keeps game modules decoupled from low-level initialization.
Rendering stack and rendering pipeline:
GraphicsDeviceinitializes and owns D3D11 resources and frame targetsShapeRenderer2Dhandles 2D primitives and UI rendering helpersPrimitiveRenderer3Dhandles debug/simple 3D primitivesModelRendererrenders imported model assets with material/light dataFrameRendererorchestrates frame execution and render mode behavior- Render passes live in
Core/Graphics/Rendering/Pipeline/Passes- Deferred path includes geometry, lighting, and composite passes
- Additional passes exist for shadows, particles, overlays, and UI
Responsibility: this is the rendering subsystem plus frame orchestration logic.
Gameplay foundation for 3D scenes:
Sceneimplements entity/component/system orchestration- Components include transform/model/material/velocity/collider/tag/attachment data
- Systems include transform propagation, velocity integration, collision, and rendering
- Additional game-specific systems can be plugged in per module
Responsibility: reusable gameplay runtime for features that should not be rewritten per game.
Core/Input- keyboard/mouse state and raw input deltasCore/Audio- sound loading, one-shots, looped sounds, runtime controlCore/Assets- path resolving and cached asset loadingCore/UI- bitmap font drawing and custom UI widgetsCore/Physics- shared collision/math structures and queriesCore/Math- transforms and helper math utilities
Current setup is Windows-focused:
- Windows 10/11
- CMake 3.21+
- C++20 compiler (Visual Studio/MSVC recommended)
- vcpkg
Dependencies (from CMakeLists.txt):
directxtkassimp
System libraries:
d3d11,dxgi,d3dcompiler,dxguid,user32,gdi32
This project is expected to be built in Debug during active development.
- Clone and bootstrap
vcpkg:
git clone https://github.com/microsoft/vcpkg.git C:\dev\vcpkg
cd C:\dev\vcpkg
.\bootstrap-vcpkg.bat- Optional but recommended environment variables for the current terminal session:
$env:VCPKG_ROOT="C:\dev\vcpkg"
$env:Path="$env:VCPKG_ROOT;$env:Path"
vcpkg version- Install required ports:
vcpkg install directxtk:x64-windows assimp:x64-windowsFrom repository root:
cmake -S . -B cmake-build-debug `
-G "Visual Studio 17 2022" `
-A x64 `
-DCMAKE_TOOLCHAIN_FILE=C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake `
-DVCPKG_TARGET_TRIPLET=x64-windowsNotes:
-DCMAKE_TOOLCHAIN_FILE=.../vcpkg.cmakeis required forfind_package(directxtk)andfind_package(assimp)to resolve correctly.x64-windowsmust match installed triplets.
cmake --build cmake-build-debug --config DebugExpected binary:
cmake-build-debug/PingPong.exe
.\cmake-build-debug\PingPong.exemain.cpp selects the active module:
constexpr auto demo = DemoType::Katamari;Available options:
DemoType::Pong
DemoType::SolarSystem
DemoType::Katamari
DemoType::LightingTestCMakeLists.txt copies runtime data into the build folder:
Core/ShadersGame/Pong/AssetsGame/SolarSystem/AssetsGame/Katamari/Assets(if the folder exists)
If assets/shaders seem outdated, rebuild the target to trigger copy/sync post-build steps.
Mini-Engine-With-Games/
├── Core/ # Shared engine runtime
│ ├── App/ # App lifecycle, IGame contract, AppContext
│ ├── Platform/ # Native window integration
│ ├── Input/ # Keyboard/mouse/raw input
│ ├── Graphics/ # Device, renderers, cameras, shaders, frame pipeline
│ │ └── Rendering/Pipeline/Passes/ # Frame pass implementations
│ ├── Gameplay/ # Scene ECS-style data + systems
│ ├── Physics/ # Collision/math primitives and queries
│ ├── Math/ # Transform and shared math helpers
│ ├── Assets/ # Asset resolving/loading/cache
│ ├── Audio/ # Audio runtime
│ ├── UI/ # UI framework and widgets
│ └── Shaders/ # Runtime shader source files
├── Game/ # Game-specific modules
│ ├── Pong/ # 2D arcade gameplay module
│ ├── SolarSystem/ # 3D simulation-style demo module
│ ├── Katamari/ # 3D gameplay + debug/render stress module
│ └── LightingTest/ # Rendering validation scene
├── Images/ # README screenshots
├── main.cpp # Active game selection
└── CMakeLists.txt # Build configuration and runtime copy rules
GIFs grow huge quickly (full-screen, long duration, high FPS). This repo ignores Images/game_play.gif and Images/solar_game_play.gif so they are not committed. Keep small assets in Git (for example pong_game_play.gif is fine).
Practical options:
- Compress before committing (stay roughly under a few MB for README): lower resolution, fewer colors, shorter loop, ~10–15 FPS. Tools: ezgif.com, ScreenToGif export settings, or
ffmpeg(scale + fps + palette). - MP4 in a Release instead of GIF: much smaller for the same quality; link it from the README.
- Git LFS only if you really need large binaries in Git: install Git LFS, then
git lfs track "*.gif"before adding. Note GitHub LFS storage and bandwidth quotas.
Example ffmpeg idea (adjust width and fps to taste):
ffmpeg -i game_play.gif -vf "fps=12,scale=960:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" game_play_small.gif








