diff src/video/SDL_video.c @ 5172:ededa1ccf91c

Switched the SDL 1.2 compatibility to use the window surface, so it's fast even when there's no hardware acceleration available. This means that the YUV overlay now uses software, but that's okay since fast YUV code should be using the textures now anyway.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 03 Feb 2011 21:13:55 -0800
parents db487f28419e
children 51b4cfdf7ebb
line wrap: on
line diff
--- a/src/video/SDL_video.c	Thu Feb 03 17:42:58 2011 -0800
+++ b/src/video/SDL_video.c	Thu Feb 03 21:13:55 2011 -0800
@@ -1391,6 +1391,9 @@
 
     if (!window->surface) {
         window->surface = SDL_CreateWindowFramebuffer(window);
+        if (window->surface) {
+            window->surface->refcount = 0x7FFFFFF;
+        }
     }
     return window->surface;
 }
@@ -1472,6 +1475,7 @@
 SDL_OnWindowResized(SDL_Window * window)
 {
     if (window->surface) {
+        window->surface->refcount = 0;
         SDL_FreeSurface(window->surface);
         window->surface = NULL;
     }
@@ -1552,6 +1556,10 @@
     /* Restore video mode, etc. */
     SDL_UpdateFullscreenMode(window, SDL_FALSE);
 
+    if (window->surface) {
+        window->surface->refcount = 0;
+        SDL_FreeSurface(window->surface);
+    }
     if (_this->DestroyWindowFramebuffer) {
         _this->DestroyWindowFramebuffer(_this, window);
     }