[KMSDRM] No need to use an SDL_VideoDisplay pointer to access display index.

This commit is contained in:
Vanfanel 2021-03-30 11:41:26 +02:00 committed by Ryan C. Gordon
parent 033c0abb58
commit 942aa7bd07
1 changed files with 2 additions and 3 deletions

View File

@ -208,8 +208,7 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS,
SDL_bool mode_found = SDL_FALSE; SDL_bool mode_found = SDL_FALSE;
/* Get the display index from the display being used by the window. */ /* Get the display index from the display being used by the window. */
SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); int display_index = SDL_atoi(SDL_GetDisplayForWindow(window)->name);
int display_index = SDL_atoi(display->name);
int i; int i;
/* Get the function pointers for the functions we will use. */ /* Get the function pointers for the functions we will use. */
@ -346,7 +345,7 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS,
goto clean; goto clean;
} }
/* Get the props of the videomodes for the first display. */ /* Get the props of the videomodes for the display. */
modes_props = (VkDisplayModePropertiesKHR *) SDL_malloc(mode_count * sizeof(*modes_props)); modes_props = (VkDisplayModePropertiesKHR *) SDL_malloc(mode_count * sizeof(*modes_props));
vkGetDisplayModePropertiesKHR(gpu, vkGetDisplayModePropertiesKHR(gpu,
displays_props[display_index].display, displays_props[display_index].display,