mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
Fix for #13094
This commit is contained in:
parent
8bba24757d
commit
98eaa05a9f
1 changed files with 9 additions and 2 deletions
|
|
@ -1250,9 +1250,12 @@ EGLSurface SDL_EGL_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, Nat
|
|||
// max 16 key+value pairs, plus terminator.
|
||||
EGLint attribs[33];
|
||||
int attr = 0;
|
||||
|
||||
bool use_opaque_ext;
|
||||
|
||||
EGLSurface surface;
|
||||
|
||||
use_opaque_ext = true;
|
||||
try:
|
||||
if (!SDL_EGL_ChooseConfig(_this)) {
|
||||
return EGL_NO_SURFACE;
|
||||
}
|
||||
|
|
@ -1282,7 +1285,7 @@ EGLSurface SDL_EGL_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, Nat
|
|||
}
|
||||
|
||||
#ifdef EGL_EXT_present_opaque
|
||||
if (SDL_EGL_HasExtension(_this, SDL_EGL_DISPLAY_EXTENSION, "EGL_EXT_present_opaque")) {
|
||||
if (SDL_EGL_HasExtension(_this, SDL_EGL_DISPLAY_EXTENSION, "EGL_EXT_present_opaque") && use_opaque_ext) {
|
||||
bool allow_transparent = false;
|
||||
if (window && (window->flags & SDL_WINDOW_TRANSPARENT)) {
|
||||
allow_transparent = true;
|
||||
|
|
@ -1323,6 +1326,10 @@ EGLSurface SDL_EGL_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, Nat
|
|||
_this->egl_data->egl_config,
|
||||
nw, &attribs[0]);
|
||||
if (surface == EGL_NO_SURFACE) {
|
||||
if (_this->egl_data->eglGetError() == EGL_BAD_ATTRIBUTE && use_opaque_ext) {
|
||||
use_opaque_ext = false;
|
||||
goto try;
|
||||
}
|
||||
SDL_EGL_SetError("unable to create an EGL window surface", "eglCreateWindowSurface");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue