Shuts down all subsystems and immediately terminates the application.
Takes no parameters.
Returns nothing (never returns - terminates process).
3D Graphics
Parameters & Returns
Parameters
This function takes no parameters.
Returns
Void
Quick Summary
Shuts down all subsystems and immediately terminates the application.
Takes no parameters.
Returns nothing (never returns - terminates process).
Technical Exegesis...
Shuts down all subsystems and immediately terminates the application. Takes no parameters.
Shuts down all subsystems and immediately terminates the application. Takes no parameters. Cleanup sequence: (1) DX12_3D_Cleanup - releases DirectX 12 resources (device, command queues, swap chain, render targets, depth buffers, descriptor heaps, root signatures, pipeline states), (2) BBR_Audio_Cleanup - stops all sounds, releases audio engine, (3) BBR_Network_Cleanup - closes sockets, shuts down network subsystem, (4) bgiCleanup - destroys BGI windows and controls, (5) ExitProcess(0) - immediately terminates process without further cleanup or atexit handlers. Never returns. Should be called at end of main loop or when user closes window. Does not return control to caller - process terminates immediately.
This function performs orderly shutdown then force-exits. DX12_3D_Cleanup releases COM objects in reverse initialization order: pipeline states, root signatures, descriptor heaps, depth buffers, render targets, swap chain, command queues, device. Uses Release() on all COM interfaces. Waits for GPU idle before releasing resources to prevent use-after-free. Audio cleanup stops playback, releases voices, destroys audio graph. Network cleanup calls WSACleanup on Windows. bgiCleanup destroys windows via DestroyWindow, unregisters window classes. ExitProcess(0) terminates immediately - does NOT call destructors for static objects, does NOT flush file buffers, does NOT call atexit handlers. Use for clean exit when all important data already saved. Alternative: return from WinMain for graceful exit with cleanup. ExitProcess ensures no resource leaks visible to OS - all handles closed automatically. Exit code 0 = success. Common pattern: detect WM_CLOSE, call b3dEnd. Not recommended during development (prevents debugger cleanup) - use only in release builds or when explicit termination required.