Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fixed recursion crash when setting SDL_VIDEO_RENDERER=software

  • Loading branch information
slouken committed Feb 4, 2011
1 parent 8c576bf commit f9e38d4eff01476fd48db082d78cdfb5a0fd3f3f
Showing with 13 additions and 1 deletion.
  1. +13 −1 src/video/SDL_video.c
@@ -126,7 +126,19 @@ SDL_CreateWindowTexture(_THIS, SDL_Window * window, Uint32 * format, void ** pix

renderer = data->renderer;
if (!renderer) {
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
SDL_RendererInfo info;
int i;

/* We need to make sure we don't get a software renderer */
for (i = 0; i < SDL_GetNumRenderDrivers(); ++i) {
SDL_GetRenderDriverInfo(i, &info);
if (SDL_strcmp(info.name, "software") != 0) {
renderer = SDL_CreateRenderer(window, i, 0);
if (renderer) {
break;
}
}
}
if (!renderer) {
return -1;
}

0 comments on commit f9e38d4

Please sign in to comment.