Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Override renderer for OpenGL window, only in case if OpenGL or OpenGL…
Browse files Browse the repository at this point in the history
… ES renderers are enabled.
  • Loading branch information
llmike committed Nov 24, 2009
1 parent 8ea783f commit bd3cfd5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/video/SDL_video.c
Expand Up @@ -1493,9 +1493,16 @@ SDL_CreateRenderer(SDL_WindowID windowID, int index, Uint32 flags)
char *override = SDL_getenv("SDL_VIDEO_RENDERER");
int n = SDL_GetNumRenderDrivers();

#if SDL_VIDEO_RENDER_OGL
if (!override && (window->flags & SDL_WINDOW_OPENGL)) {
override = "opengl";
}
#endif /* SDL_VIDEO_RENDER_OGL */
#if SDL_VIDEO_RENDER_OGL_ES
if (!override && (window->flags & SDL_WINDOW_OPENGL)) {
override = "opengl_es";
}
#endif /* SDL_VIDEO_RENDER_OGL_ES */
if (override) {
for (index = 0; index < n; ++index) {
SDL_RenderDriver *driver =
Expand Down

0 comments on commit bd3cfd5

Please sign in to comment.