ScnLib_EnableGameCaptureMode()

ScnLib_EnableGameCaptureMode()

Std EditionPro EditionMax EditionUltra Edition
C++ __declspec(dllimport) void __stdcall ScnLib_EnableGameCaptureMode(BOOL bEnable);
C# [DllImport("ScnLib.dll")] public static extern void ScnLib_EnableGameCaptureMode(bool Enable);
Basic Public Declare Sub ScnLib_EnableGameCaptureMode Lib "ScnLib.dll" (ByVal Enable As Boolean)
Delphi procedure ScnLib_EnableGameCaptureMode(Enable: LongBool); stdcall; external 'ScnLib.dll';
  • Description
    Toggle the game screen capture mode.

  • Parameters
    • Enable [in]
      TRUE: Activate game screen capture mode.
      FALSE: Deactivate game screen capture mode.
  • Return Value
    None.

  • Remarks
    Windows-based computer games typically utilize Direct3D/OpenGL hardware acceleration for rendering impressive real-time 3D visuals. Similarly, various multimedia applications (like media players) also employ Direct3D/OpenGL for content rendering. Capturing screens rendered via Direct3D/OpenGL can be challenging for standard techniques (like GDI screen capture or DXGI desktop duplication) in terms of performance. However, this SDK employs a specialized API-hook technique for efficient Direct3D/OpenGL screen capture. It can automatically detect the location of the Direct3D/OpenGL rendered screen and even overlay custom elements (e.g., recording status, game frame rate) on top of it.

    By default, the game screen capture mode is inactive, and the SDK uses non-API-hook methods to capture the specified screen area. Activating the game screen capture mode with this function enables API-hook-based capturing. In this mode, the SDK identifies the target game window following these criteria:
    • If you set a game window as the capture target by using ScnLib_SetCaptureWnd(). If the SDK detects Direct3D/OpenGL rendering in the window's client area, it employs API-hook for capturing. If not, it reverts to alternative screen capture methods for the window's client area.
    • If no specific game window is set, the SDK automatically evaluates whether the active foreground window is using Direct3D/OpenGL for rendering. If this is the case, the window is set as the target game window for API-hook capture. If not, it reverts to alternative screen capture methods for the last set screen area.
    It's important to note that to ensure successful screen recording with the game screen capture mode activated, it's recommended to run the process with administrator privileges. This is because if the target game process has administrator privileges, the SDK might not be able to capture the Direct3D/OpenGL rendered screen through API-hook without sufficient privileges.

    To verify if the game screen capture mode is active, call ScnLib_IsGameCaptureModeEnabled().

  • See Also
    ScnLib_IsGameCaptureModeEnabled()
    ScnLib_IsGPUAccelerationEnabled()
    ScnLib_SetCaptureWnd()
    ScnLib_GetGamePath()
    ScnLib_GetGameWnd()
    ScnLib_ShowInGameOverlay()

Try the SDK for FREE SDK APIs overview