Get the desktop area represented by a display.
int SDL_GetDisplayBounds(SDL_DisplayID displayID, SDL_Rect *rect);
displayID | the instance ID of the display to query |
rect | the SDL_Rect structure filled in with the display bounds |
Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.
The primary display is always located at (0,0).
This function is available since SDL 3.0.0.
SDL_Rect r;if (SDL_GetDisplayBounds(0, &r) != 0) {
"SDL_GetDisplayBounds failed: %s", SDL_GetError());
SDL_Log(return 1;
}