Get the desktop area represented by a display.
Defined in <SDL3/SDL_video.h>
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_Log("SDL_GetDisplayBounds failed: %s", SDL_GetError());
return 1;
}