Only set the OpenGL flag if the OpenVR driver is active

This commit is contained in:
Sam Lantinga committed 2024-10-21 15:22:56 -07:00
1 parent 82b3325978
commit 1c51b8dc33
1 file changed
+5 -4
+5 -4
View File
@@ -277,6 +277,11 @@ static Uint32 SDL_DefaultGraphicsBackends(SDL_VideoDevice *_this)
if (_this->Metal_CreateView) {
return SDL_WINDOW_METAL;
}
#endif
#if defined(SDL_VIDEO_OPENGL) && defined(SDL_VIDEO_DRIVER_OPENVR)
if (SDL_strcmp(_this->name, "openvr") == 0) {
return SDL_WINDOW_OPENGL;
}
#endif
return 0;
}
@@ -2342,10 +2347,6 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props)
flags |= SDL_DefaultGraphicsBackends(_this);
}
#if defined(SDL_VIDEO_OPENGL) && defined(SDL_VIDEO_DRIVER_OPENVR)
flags |= SDL_WINDOW_OPENGL;
#endif
if (flags & SDL_WINDOW_OPENGL) {
if (!_this->GL_CreateContext) {
SDL_ContextNotSupported("OpenGL");