diff src/video/win32/SDL_gdirender.c @ 1924:69217fdd2c0a

If the OpenGL renderer is selected for a non-OpenGL window, recreate the window with OpenGL enabled. Added OpenGL renderer error checking. Use fast-path texture formats in the OpenGL renderer.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 22 Jul 2006 21:02:57 +0000
parents 8a162bfdc838
children a788656ca29a
line wrap: on
line diff
--- a/src/video/win32/SDL_gdirender.c	Sat Jul 22 19:51:48 2006 +0000
+++ b/src/video/win32/SDL_gdirender.c	Sat Jul 22 21:02:57 2006 +0000
@@ -249,7 +249,6 @@
     if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
         data->yuv = SDL_SW_CreateYUVTexture(texture);
         if (!data->yuv) {
-            GDI_DestroyTexture(renderer, texture);
             return -1;
         }
         data->format = display->current_mode.format;
@@ -266,7 +265,6 @@
         bmi_size = sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD);
         bmi = (LPBITMAPINFO) SDL_calloc(1, bmi_size);
         if (!bmi) {
-            GDI_DestroyTexture(renderer, texture);
             SDL_OutOfMemory();
             return -1;
         }
@@ -291,7 +289,6 @@
                                           ncolors * sizeof(PALETTEENTRY));
             if (!palette) {
                 SDL_free(bmi);
-                GDI_DestroyTexture(renderer, texture);
                 SDL_OutOfMemory();
                 return -1;
             }
@@ -327,7 +324,6 @@
         data->pixels = NULL;
     }
     if (!data->hbm) {
-        GDI_DestroyTexture(renderer, texture);
         WIN_SetError("Couldn't create bitmap");
         return -1;
     }