Skip to content

Commit

Permalink
Only set the OpenGL flag if the OpenVR driver is active
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 21, 2024
1 parent fd5f7a0 commit 5a46522
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/video/SDL_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 5a46522

Please sign in to comment.