hedgewars/CCHandlers.inc
changeset 3598 a8aa06bae895
parent 3551 d4de36b3801a
child 3611 ed00aa2b339e
--- a/hedgewars/CCHandlers.inc	Wed Jun 30 22:20:52 2010 +0200
+++ b/hedgewars/CCHandlers.inc	Wed Jun 30 22:42:55 2010 +0200
@@ -682,9 +682,6 @@
 {$IFDEF DEBUGFILE}
     buf: array[byte] of char;
 {$ENDIF}
-{$IFDEF SDL13}
-    window: PSDL_Window;
-{$ENDIF}
 begin
     s:= s; // avoid compiler hint
     if Length(s) = 0 then cFullScreen:= not cFullScreen
@@ -734,10 +731,13 @@
     end;
     
 {$IFDEF SDL13}
-    window:= SDL_CreateWindow('Hedgewars', 0, 0, cScreenWidth, cScreenHeight,
-        SDL_WINDOW_OPENGL or SDL_WINDOW_SHOWN    
-        {$IFDEF IPHONEOS} or SDL_WINDOW_BORDERLESS{$ENDIF});     
-    SDL_CreateRenderer(window, -1, 0);
+    if SDLwindow = nil then
+    begin
+        SDLwindow:= SDL_CreateWindow('Hedgewars', 0, 0, cScreenWidth, cScreenHeight,
+                        SDL_WINDOW_OPENGL or SDL_WINDOW_SHOWN    
+                        {$IFDEF IPHONEOS} or SDL_WINDOW_BORDERLESS{$ENDIF});     
+        SDL_CreateRenderer(SDLwindow, -1, 0);
+    end;
     
     SDL_SetRenderDrawColor(0, 0, 0, 255);    
     SDL_RenderFill(nil);