mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-18 10:48:28 +00:00
Displays are now referenced by instance ID instead of index
This commit is contained in:
parent
758c0dd6d8
commit
22c69bccdf
157 changed files with 1620 additions and 1589 deletions
|
@ -915,15 +915,15 @@ static SDL_RenderLineMethod SDL_GetRenderLineMethod()
|
|||
|
||||
static void SDL_CalculateSimulatedVSyncInterval(SDL_Renderer *renderer, SDL_Window *window)
|
||||
{
|
||||
int display_index = SDL_GetWindowDisplayIndex(window);
|
||||
SDL_DisplayID displayID = SDL_GetDisplayForWindow(window);
|
||||
SDL_DisplayMode mode;
|
||||
float refresh_rate;
|
||||
int num, den;
|
||||
|
||||
if (display_index < 0) {
|
||||
display_index = 0;
|
||||
if (displayID == 0) {
|
||||
displayID = SDL_GetPrimaryDisplay();
|
||||
}
|
||||
if (SDL_GetDesktopDisplayMode(display_index, &mode) == 0 && mode.refresh_rate > 0.0f) {
|
||||
if (SDL_GetDesktopDisplayMode(displayID, &mode) == 0 && mode.refresh_rate > 0.0f) {
|
||||
refresh_rate = mode.refresh_rate;
|
||||
} else {
|
||||
/* Pick a good default refresh rate */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue