# Copyright (C) 2007  Peter De Wachter <pdewacht@gmail.com>
# Distributed under the same license as the game. See debian/copyright.

Index: a7xpg-0.11.dfsg1/src/abagames/util/sdl/Screen3D.d
===================================================================
--- a7xpg-0.11.dfsg1.orig/src/abagames/util/sdl/Screen3D.d	2007-09-02 20:34:16.000000000 +0200
+++ a7xpg-0.11.dfsg1/src/abagames/util/sdl/Screen3D.d	2007-09-02 20:34:43.000000000 +0200
@@ -26,6 +26,7 @@
   float farPlane = 1000;
 
  private:
+  Uint32 videoFlags;
 
   protected abstract void init();
   protected abstract void close();
@@ -41,7 +42,6 @@
 	"Unable to initialize SDL: " ~ string.toString(SDL_GetError()));
     }
     // Create an OpenGL screen.
-    Uint32 videoFlags;
     if (windowMode) {
       videoFlags = SDL_OPENGL | SDL_RESIZABLE;
     } else {
@@ -61,6 +61,11 @@
   // Reset viewport when the screen is resized.
 
   public void screenResized() {
+    if (SDL_SetVideoMode(width, height, 0, videoFlags) == null) {
+      throw new Exception
+        ("Unable to resize SDL screen: " ~ std.string.toString(SDL_GetError()));
+    }
+
     glViewport(0, 0, width, height);
     glMatrixMode(GL_PROJECTION);
     glLoadIdentity();
