diff src/video/SDL_video.c @ 3092:cad1aefa2ed9

Date: Thu, 12 Mar 2009 15:14:38 +0200 From: "Mike Gorchak" Subject: New QNX patches In photon.tar.gz there are new files to be placed into ./src/video/photon/ directory. qnx3.diff - new patches for QNX support. Since I've found a lot of bugs in the new GF QNX Graphics Framework and I'm suspended development for GF driver until already found bugs will be fixed and switched to Photon driver implementation. sdl.diff - I've found that renderer creation result has not been checked and SDL shows error like: "there is no current renderer", now SDL will show correct error which was set be renderer.
author Sam Lantinga <slouken@libsdl.org>
date Tue, 17 Mar 2009 03:24:22 +0000
parents 32efcc94b3da
children 82e60908fab1
line wrap: on
line diff
--- a/src/video/SDL_video.c	Sun Mar 15 15:50:18 2009 +0000
+++ b/src/video/SDL_video.c	Tue Mar 17 03:24:22 2009 +0000
@@ -664,6 +664,7 @@
         SDL_SetError("Couldn't find display mode match");
         return -1;
     }
+
     if (SDL_memcmp
         (&fullscreen_mode, &display->fullscreen_mode,
          sizeof(fullscreen_mode)) == 0) {
@@ -1492,6 +1493,13 @@
     /* Create a new renderer instance */
     window->renderer = SDL_CurrentDisplay.render_drivers[index]
         .CreateRenderer(window, flags);
+
+    if (window->renderer==NULL)
+    {
+       /* Assuming renderer set its error */
+       return -1;
+    }
+
     SDL_SelectRenderer(window->id);
 
     return 0;