Fixed crash creating a window with the Vivante video driver

This commit is contained in:
Sam Lantinga 2023-05-12 16:23:56 -07:00
parent 92a59333ba
commit e596dd8dad
1 changed files with 2 additions and 2 deletions

View File

@ -245,7 +245,7 @@ int VIVANTE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window)
SDL_DisplayData *displaydata; SDL_DisplayData *displaydata;
SDL_WindowData *data; SDL_WindowData *data;
displaydata = SDL_GetDisplayDriverData(0); displaydata = SDL_GetDisplayDriverData(SDL_GetPrimaryDisplay());
/* Allocate window internal data */ /* Allocate window internal data */
data = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData)); data = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData));
@ -349,7 +349,7 @@ void VIVANTE_HideWindow(SDL_VideoDevice *_this, SDL_Window *window)
int VIVANTE_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info) int VIVANTE_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info)
{ {
SDL_WindowData *data = window->driverdata; SDL_WindowData *data = window->driverdata;
SDL_DisplayData *displaydata = SDL_GetDisplayDriverData(0); SDL_DisplayData *displaydata = SDL_GetDisplayDriverData(SDL_GetPrimaryDisplay());
info->subsystem = SDL_SYSWM_VIVANTE; info->subsystem = SDL_SYSWM_VIVANTE;
info->info.vivante.display = displaydata->native_display; info->info.vivante.display = displaydata->native_display;