* Melchior FRANZ -- Tuesday 25 April 2006 20:03:
> [...] if we want a more usable fullscreen with SDL, then we can have
> it. It's just a setup question in fgfs.

Here's a solution for SDL>= 1.2.10. It doesn't simply use SDL's
fullscreen (which the user didn't ask for -- he asked for FlightGear's),
but opens the window in desktop size without frame. No idea if anyone
wants that, and if it works on MS Windows or other legacy operating
systems.  :-)

m.


Index: fg_os_sdl.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Main/fg_os_sdl.cxx,v
retrieving revision 1.13
diff -u -p -r1.13 fg_os_sdl.cxx
--- fg_os_sdl.cxx       16 Feb 2006 21:02:09 -0000      1.13
+++ fg_os_sdl.cxx       25 Apr 2006 20:25:34 -0000
@@ -25,7 +25,7 @@ static int CurrentMouseX = 0;
 static int CurrentMouseY = 0;
 static int CurrentMouseCursor = MOUSE_CURSOR_POINTER;
 static bool NeedRedraw = false;
-static int VidMask = SDL_OPENGL|SDL_RESIZABLE;
+static int VidMask = SDL_OPENGL;

 void fgRegisterIdleHandler(fgIdleHandler func)
 {
@@ -86,9 +86,21 @@ void fgOSOpenWindow(int w, int h, int bp
     SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, zbits);
     SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);

-    if(fullscreen) {
-        VidMask |= SDL_FULLSCREEN;
+    if (fullscreen) {
+        if (SDL_VERSION_ATLEAST(1, 2, 10)) {
+            VidMask |= SDL_NOFRAME;
+            const SDL_VideoInfo *vi = SDL_GetVideoInfo();
+            w = vi->current_w;
+            h = vi->current_h;
+            if (WindowResizeHandler)
+                (*WindowResizeHandler)(w, h);
+        } else {
+            VidMask |= SDL_FULLSCREEN;
+        }
+    } else {
+        VidMask |= SDL_RESIZABLE;
     }
+
     if (SDL_SetVideoMode(w, h, 16, VidMask) == 0)
         throw sg_throwable(string("Failed to set SDL video mode: ")
                                    + SDL_GetError());


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to