Skip to content

Commit

Permalink
Do not overwrite window surface created by driver
Browse files Browse the repository at this point in the history
If a driver's implementation of CreateWindowFramebuffer sets the window
surface, use that rather than overwriting it. A driver may set the window
surface if data cannot be passed via the CreateWindowFramebuffer output
parameters (e.g. surface palette colors).
  • Loading branch information
jayschwa committed Mar 23, 2020
1 parent 1fd548b commit e0a2705
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/video/SDL_video.c
Expand Up @@ -2319,6 +2319,10 @@ SDL_CreateWindowFramebuffer(SDL_Window * window)
return NULL;
}

if (window->surface) {
return window->surface;
}

if (!SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
return NULL;
}
Expand Down

0 comments on commit e0a2705

Please sign in to comment.