Hey everyone! ![]()
Today marks Day 4 of my journey building TitanEngine completely from scratch using C++20 and native DirectX 12, with zero bloated third-party templates or high-level helper wrappers.
After setting up our device, command queue, and swap chain in the previous sessions, today we achieved a major milestone: rendering our very first frame and clearing the screen with pure hardware control!
Here is what was implemented today:
-
Command Allocator & List: Initialized and managed
ID3D12CommandAllocatorandID3D12GraphicsCommandListto record and reset rendering commands frame by frame. -
Manual Resource Barriers: Handled
D3D12_RESOURCE_BARRIERstates to transition our back buffers manually betweenPRESENTandRENDER_TARGET. -
First Frame Clear: Bound our Render Target View using raw descriptor handle pointer arithmetic and cleared the screen with a custom engine background color.
-
Deterministic Synchronization: Implemented an
ID3D12Fencealongside native Win32 Event handles (WaitForSingleObject) to completely prevent CPU-GPU race conditions.
You can check out the full step-by-step breakdown and code walkthrough in the latest video update here:
Watch Day 4 on YouTube: https://youtu.be/QbUPJpvIqFU
Feedback, architectural thoughts, or questions from fellow engine programmers are always welcome. Let’s keep building low-level! ![]()