Begins a new 3D frame by clearing the render target and preparing the command list.
Takes no parameters.
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
This function takes no parameters.
Returns
Void
Quick Summary
Begins a new 3D frame by clearing the render target and preparing the command list.
Takes no parameters.
Returns nothing.
Technical Exegesis...
Begins a new 3D frame by clearing the render target and preparing the command list. Takes no parameters. Must be called before any rendering commands each frame. Call sequence: b3dCls3D -> b3dRenderWorld -> b3dFlip3D. Determines rendering target: if active canvas (bgiSetActiveCanvas), renders to canvas swap chain; otherwise renders to main window swap chain. Waits on frame latency waitable object to prevent CPU running too far ahead of GPU.
Begins a new 3D frame by clearing the render target and preparing the command list. Takes no parameters. Must be called before any rendering commands each frame. Call sequence: b3dCls3D -> b3dRenderWorld -> b3dFlip3D. Determines rendering target: if active canvas (bgiSetActiveCanvas), renders to canvas swap chain; otherwise renders to main window swap chain. Waits on frame latency waitable object to prevent CPU running too far ahead of GPU. Allocates command context from CommandListManager (recycled command list + allocator). Transitions render target from PRESENT to RENDER_TARGET state using resource barrier. Clears render target to background color set by b2dSetClsColor (default black). Clears depth buffer to 1.0 (far plane). Sets viewport and scissor rect to render target dimensions. Prepares for OMSetRenderTargets. Returns nothing.
This function implements frame pacing and resource management. Frame latency waitable object signals when GPU finishes frame N-3, allowing CPU to start frame N. Prevents input lag while maintaining smooth frame rate. CommandListManager pattern: maintains pool of ID3D12CommandAllocator objects, one per frame in flight. Allocators reset after GPU completes frame. Command lists recorded into allocators. Resource barrier synchronization: render target must be in RENDER_TARGET state for ClearRenderTargetView/OMSetRenderTargets, PRESENT state for Present(). Background color from b2dSetClsColor enables matching 2D/3D backgrounds. Depth clear to 1.0 (reversed-Z or standard Z depends on projection). Viewport maps NDC to screen coordinates. Scissor rect clips rendering to bounds. Canvas support: when canvas active, uses canvas->swapChain, canvas->renderTargetView, canvas->depthStencilView. Main window vs canvas determined by g_activeCanvasID. Essential first call every frame - establishes rendering context. Pair with b3dFlip3D to complete frame.