How OBS Captures Exclusive Fullscreen Games on Windows

OBS Studio achieves low-latency capture of exclusive fullscreen games on Windows by intercepting graphics rendering calls directly within the game's process rather than polling the desktop output. By using dynamic dynamic-link library (DLL) injection to hook API presentation routines and transferring frames through shared GPU surface handles, OBS bypasses the Desktop Window Manager (DWM) pipeline, eliminating desktop composition overhead and frame buffering delays.

Dynamic DLL Injection and API Hooking

When OBS Studio initiates a Game Capture session, it uses a helper process to inject a hook library (graphics-hook32.dll or graphics-hook64.dll) into the target game's process memory space.

Once injected, the hook identifies the graphics API in use—such as DirectX 9, 11, 12, Vulkan, or OpenGL—and patches the virtual method tables (VMT) of the game's presentation interfaces. Specifically, it hooks core presentation functions, such as IDXGISwapChain::Present, Present1, or OpenGL's wglSwapBuffers.

Because the hook executes inside the game's own thread right as a frame finishes rendering, OBS accesses the backbuffer immediately before it is queued for display.

Bypassing Desktop Window Manager (DWM) Delays

Standard desktop capture methods, such as GDI capture or the Desktop Duplication API, rely on capturing the desktop surface managed by Windows DWM. In exclusive fullscreen mode, DWM composition is typically bypassed or minimized by the OS to reduce input lag, giving the application direct control over the display scanout.

If a capture tool attempts to capture the screen via the operating system's desktop composition layers, it can force synchronization stalls or introduce a multi-frame composition buffer delay. OBS Game Capture avoids this entirely:

  • Capture occurs inside the application pipeline before hardware scanout.
  • No reliance on Windows composition cycles, DWM refresh synchronization, or VSync-bound desktop surfaces.
  • Frame capture latency is tied directly to the game's native render loop.

GPU-Side Frame Sharing via DXGI Handles

To transfer the captured frame from the game process to the OBS Studio process without dropping performance, OBS avoids copying frame data back to system RAM (CPU memory).

Instead, OBS uses hardware-level texture sharing:

  1. The injected hook creates a shared DirectX surface or retrieves a shared NT handle using DXGI inter-process communication APIs (CreateSharedHandle or IDXGIResource::GetSharedHandle).
  2. The backbuffer contents are copied directly to this shared texture inside the GPU VRAM via direct GPU-to-GPU memory copies (such as CopyResource or CopySubresourceRegion).
  3. OBS Studio opens the shared handle within its own rendering context using OpenSharedResource.
  4. The texture is fed directly into OBS's compositing and encoding pipelines entirely within GPU memory.

Cross-Process Synchronization

To prevent screen tearing and race conditions while the game writes to and OBS reads from the shared surface, OBS utilizes GPU synchronization primitives, such as IDXGIKeyedMutex or modern direct-fence implementations. This guarantees that OBS only samples fully rendered frames without blocking the game's render thread, preserving native game frame rates and ensuring zero composition delay.