This project demonstrates a minimal modular DirectX 11 rendering engine written in C++ that renders a rotating cube with lighting.
The goal of the project is to provide a clean, educational example of a DirectX 11 rendering pipeline that can be used for learning graphics programming or as a starting point for small rendering engines.
This project illustrates:
- creation of a Win32 window
- DirectX 11 device and swap chain initialization
- shader compilation and usage (HLSL)
- rendering a rotating cube
- directional and point lighting
- basic engine‑style project structure
Optional preview video:
Example visual outputs:
- rotating lit cube
- dynamic lighting
- rendering updates during window resize
- real‑time frame updates
- Language: C++
- Graphics API: DirectX 11
- Platform: Windows
- Rendering Features: 3D rendering, lighting, animation
- Architecture: modular renderer + scene system
- Build System: Visual Studio
Recommended hardware:
- GPU supporting DirectX 11+
- 4GB RAM minimum
- modern multi‑core CPU
Required software:
- Windows 10 or newer
- DirectX runtime
- Visual Studio 2019 / 2022
- Windows SDK
Recommended development environment:
- Visual Studio Community 2022
Optional tools:
- Git
- PIX for Windows
- DirectX Graphics Debugger
Steps to run the project:
- Clone the repository
- Open the project in Visual Studio
- Build the project
- Run the executable
Example:
git clone https://github.com/AhmadrezaRazian/DirectX11-Mini-Engine-Rotating-Lit-Cube-Cpp-Demo.git
Some configuration steps may be required depending on the system.
Common configurations:
- ensure the Shaders/ directory is accessible at runtime
- set the working directory to the project folder
- ensure DirectX libraries are linked correctly
Example configuration:
Project Properties → Debugging → Working Directory
$(ProjectDir)
Required DirectX libraries:
d3d11.lib
dxgi.lib
d3dcompiler.lib
DirectX11-Mini-Engine-Rotating-Lit-Cube-Cpp-Demo/
│
├─ main.cpp
│
├─ Core/
│ ├─ Window.cpp
│ └─ Window.h
│
├─ Renderer/
│ ├─ Renderer.cpp
│ └─ Renderer.h
│
├─ Graphics/
│ ├─ Mesh.cpp
│ ├─ Mesh.h
│ ├─ Shader.cpp
│ ├─ Shader.h
│ ├─ Camera.h
│ └─ Light.h
│
├─ Math/
│ └─ Transform.h
│
└─ Shaders/
├─ BasicVS.hlsl
└─ BasicPS.hlsl
Handles window creation and operating system interaction.
Responsible for:
- DirectX device initialization
- swap chain creation
- rendering pipeline setup
- frame rendering
Contains core graphics objects:
- mesh data
- shader management
- camera system
- lighting structures
Utility structures for:
- transformations
- matrices
- object positioning
GPU shader programs written in HLSL.
main.cpp starts the application and runs the rendering loop.
Application
↓
Window System
↓
Renderer
↓
Camera + Scene
↓
Shaders
↓
GPU
↓
Screen Output
Common issues:
Cause:
- shader file not found
- incorrect shader path
Solution:
- ensure shaders exist inside the Shaders/ directory
Possible causes:
- unsupported GPU
- missing DirectX runtime
Fix by setting:
$(ProjectDir)
Ensure GPU supports DirectX 11.
Current limitations of the demo:
- single object rendering
- no texture system yet
- limited camera controls
- no physics system
Possible improvements:
- camera movement controls
- texture and material system
- multiple mesh rendering
- shadow mapping
- GUI overlay
- performance profiling
Contributions are welcome.
Typical workflow:
- fork the repository
- create a feature branch
- submit a pull request
Constructive feedback and improvements are encouraged.
MIT License.
If you have any questions or want to collaborate on projects, feel free to reach out.
Do not hesitate to comment or submit PRs.
Sayed Ahmadreza Razian
AhmadrezaRazian@gmail.com
https://www.linkedin.com/in/ahmadrezarazian/
