mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-01-05 20:55:38 +00:00
ensure that SDL2 does not set conflicting window flags (thanks @pionere!)
This commit is contained in:
parent
4192d1a1c7
commit
fcc994e132
|
@ -202,6 +202,22 @@ typedef struct {
|
||||||
} SDL_WindowTextureData;
|
} SDL_WindowTextureData;
|
||||||
|
|
||||||
|
|
||||||
|
static Uint32
|
||||||
|
SDL_DefaultGraphicsBackends(SDL_VideoDevice *_this)
|
||||||
|
{
|
||||||
|
#if (SDL_VIDEO_OPENGL && __MACOSX__) || (__IPHONEOS__ && !TARGET_OS_MACCATALYST) || __ANDROID__ || __NACL__
|
||||||
|
if (_this->GL_CreateContext != NULL) {
|
||||||
|
return SDL_WINDOW_OPENGL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if SDL_VIDEO_METAL && (TARGET_OS_MACCATALYST || __MACOSX__ || __IPHONEOS__)
|
||||||
|
if (_this->Metal_CreateView != NULL) {
|
||||||
|
return SDL_WINDOW_METAL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch)
|
SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch)
|
||||||
{
|
{
|
||||||
|
@ -1635,16 +1651,7 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
|
||||||
|
|
||||||
/* Some platforms have certain graphics backends enabled by default */
|
/* Some platforms have certain graphics backends enabled by default */
|
||||||
if (!graphics_flags && !SDL_IsVideoContextExternal()) {
|
if (!graphics_flags && !SDL_IsVideoContextExternal()) {
|
||||||
#if (SDL_VIDEO_OPENGL && __MACOSX__) || (__IPHONEOS__ && !TARGET_OS_MACCATALYST) || __ANDROID__ || __NACL__
|
flags |= SDL_DefaultGraphicsBackends(_this);
|
||||||
if (_this->GL_CreateContext != NULL) {
|
|
||||||
flags |= SDL_WINDOW_OPENGL;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#if SDL_VIDEO_METAL && (TARGET_OS_MACCATALYST || __MACOSX__ || __IPHONEOS__)
|
|
||||||
if (_this->Metal_CreateView != NULL) {
|
|
||||||
flags |= SDL_WINDOW_METAL;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & SDL_WINDOW_OPENGL) {
|
if (flags & SDL_WINDOW_OPENGL) {
|
||||||
|
|
Loading…
Reference in a new issue