GameWindowInfo
Electron APIs / overlay / GameWindowInfo
Information about a running game's window.
Used to determine:
- Window size.
- Window focus.
- Graphics API used by the game.
- Screen display information.
- Bounding rectangle of the game window.
Not available at injection time: the injected client reports the window only once the
game's graphics device initializes, a few seconds after game-injected. Until then
ActiveGameInfo.gameWindowInfo is undefined. The first game-window-changed
event delivers it and is the earliest point where every field below holds a real value.
Example
overlay.on("game-window-changed", (windowInfo, gameInfo, reason) => {
if (windowInfo.focused) {
console.log(
`Game window is focused. Size: ${windowInfo.size.width}x${windowInfo.size.height}`,
);
}
});
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
bounds? | readonly | any | The bounding rectangle of the game window in the screen's coordinates. For example: bounds: { x: 100, y: 100, width: 800, height: 600 } Means the game window is positioned at (100, 100) on the screen and has a size of 800x600 pixels. Since 1.5.11. |
focused | readonly | boolean | Indicates if the game window is currently in focus. |
graphics | readonly | string | undefined | The graphics API used by the game (e.g., Direct3D 9, 11, 12, Vulkan). |
isFullscreen? | readonly | boolean | Indicates if the game is currently running in fullscreen exclusive mode. Relevant only for OOPO games. Since 1.9.0 |
isOOPOFullscreenRenderingDisabled? | readonly | boolean | Indicates if fullscreen rendering is disabled. Relevant only for OOPO games. Since 1.9.0 |
isSharedTextureAvailable? | readonly | boolean | Indicates whether shared-texture (GPU) overlay rendering can actually be used with this game. Not a precondition for creating a window: a useSharedTexture window may be created before this value resolves, and the overlay corrects the rendering path on its own. Read it to observe the outcome, or to branch when the window behaves differently on each path. true when the game's graphics API supports it (GameWindowInfo.isSharedTextureSupported), no GPU adapter mismatch was detected, and the path was not abandoned after repeated in-game copy failures. When it is false, the shared-texture-unavailable event names the reason. It can therefore turn false mid-game: the copy-failure verdict is reached only after frames were sent and repeatedly failed to draw. undefined until the game's graphics device initializes, a few seconds after game-injected; the first game-window-changed event carries the resolved value. See Overlay examples Since 2.0.5 |
isSharedTextureSupported? | readonly | boolean | Indicates whether the game's graphics API supports shared-texture (GPU) overlay rendering: true for D3D11 / D3D12, false for D3D9 / OpenGL / Vulkan. This is a capability probe only — to decide whether the path can actually be used on this machine, gate on GameWindowInfo.isSharedTextureAvailable instead. undefined until the game's graphics device initializes, a few seconds after game-injected; the first game-window-changed event carries the resolved value. Since 2.0.0 |
nativeHandle | readonly | number | The native window handle (HWND) of the game window. |
screen? | readonly | any | Display information for the screen on which the game window resides. Since 1.5.11. |
size | readonly | Size | The dimensions of the game window. |