r4037 - packages/trunk/gunroar/debian/patches
Peter De Wachter
pdewacht-guest at alioth.debian.org
Sun Sep 2 18:33:24 UTC 2007
Author: pdewacht-guest
Date: 2007-09-02 18:33:23 +0000 (Sun, 02 Sep 2007)
New Revision: 4037
Added:
packages/trunk/gunroar/debian/patches/window-resizing.patch
Modified:
packages/trunk/gunroar/debian/patches/series
Log:
fix window resizing code
Modified: packages/trunk/gunroar/debian/patches/series
===================================================================
--- packages/trunk/gunroar/debian/patches/series 2007-09-02 18:30:05 UTC (rev 4036)
+++ packages/trunk/gunroar/debian/patches/series 2007-09-02 18:33:23 UTC (rev 4037)
@@ -6,3 +6,4 @@
windowed.patch
makefile.patch
gdc-0.24-semantics-for-version.patch
+window-resizing.patch
Added: packages/trunk/gunroar/debian/patches/window-resizing.patch
===================================================================
--- packages/trunk/gunroar/debian/patches/window-resizing.patch (rev 0)
+++ packages/trunk/gunroar/debian/patches/window-resizing.patch 2007-09-02 18:33:23 UTC (rev 4037)
@@ -0,0 +1,41 @@
+Index: gunroar-0.15.dfsg1/src/abagames/util/sdl/screen3d.d
+===================================================================
+--- gunroar-0.15.dfsg1.orig/src/abagames/util/sdl/screen3d.d 2007-09-02 20:31:34.000000000 +0200
++++ gunroar-0.15.dfsg1/src/abagames/util/sdl/screen3d.d 2007-09-02 20:32:23.000000000 +0200
+@@ -23,6 +23,7 @@
+ int _width = 640;
+ int _height = 480;
+ bool _windowMode = true;
++ Uint32 _videoFlags;
+
+ protected abstract void init();
+ protected abstract void close();
+@@ -34,13 +35,12 @@
+ "Unable to initialize SDL: " ~ std.string.toString(SDL_GetError()));
+ }
+ // Create an OpenGL screen.
+- Uint32 videoFlags;
+ if (_windowMode) {
+- videoFlags = SDL_OPENGL | SDL_RESIZABLE;
++ _videoFlags = SDL_OPENGL | SDL_RESIZABLE;
+ } else {
+- videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
++ _videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
+ }
+- if (SDL_SetVideoMode(_width, _height, 0, videoFlags) == null) {
++ if (SDL_SetVideoMode(_width, _height, 0, _videoFlags) == null) {
+ throw new SDLInitFailedException
+ ("Unable to create SDL screen: " ~ std.string.toString(SDL_GetError()));
+ }
+@@ -53,6 +53,11 @@
+
+ // Reset a 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();
More information about the Pkg-games-commits
mailing list