]> git.mxchange.org Git - flightgear.git/commitdiff
Check for full screen (no windows system support) before having PUI draw
authorcurt <curt>
Sat, 4 Jul 1998 00:48:41 +0000 (00:48 +0000)
committercurt <curt>
Sat, 4 Jul 1998 00:48:41 +0000 (00:48 +0000)
it's ugly excuse for a mouse. :-)  The check is probably not general enough,
but it can be improved as more and varied hardware is tested.

GUI/gui.cxx

index 9d10999745f7ab2974b44e9e673573863bfbcdf1..84a20aafb505bdcd1e9af24ad26ae3bd23c2d3f7 100644 (file)
  * (Log is kept at end of this file)
  **************************************************************************/
 
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <Include/general.h>
+
 #include "gui.h"
-#define USING_3DFX
+
 
 puMenuBar    *mainMenuBar;
 puButton     *hideMenuButton;
@@ -125,43 +131,53 @@ puCallback helpSubmenuCb        [] = { notCb, notCb, NULL };
 
 void guiInit()
 {
-      puInit();
-#ifdef USING_3DFX
-      puShowCursor ();
-#endif
-      // puSetDefaultStyle         ( PUSTYLE_SMALL_BEVELLED );
-      puSetDefaultStyle         ( PUSTYLE_DEFAULT );
-      puSetDefaultColourScheme  (0.2, 0.4, 0.8);
+    fgGENERAL *g;
+    char *mesa_win_state;
+
+    g = &general;
+
+    // Initialize PUI
+    puInit();
+
+    // Determine if we need to render the cursor, or if the windowing
+    // system will do it.  First test if we are rendering with glide.
+    if ( strstr ( g->glRenderer, "Glide" ) ) {
+       // Test for the MESA_GLX_FX env variable
+       if ( (mesa_win_state = getenv( "MESA_GLX_FX" )) != NULL) {
+           // test if we are fullscreen mesa/glide
+           if ( (mesa_win_state[0] == 'f') || (mesa_win_state[0] == 'F') ) {
+               puShowCursor ();
+           }
+       }
+    }
+
+    // puSetDefaultStyle         ( PUSTYLE_SMALL_BEVELLED );
+    puSetDefaultStyle         ( PUSTYLE_DEFAULT );
+    puSetDefaultColourScheme  (0.2, 0.4, 0.8);
       
-      /* OK the rest is largerly put in here to mimick Steve Baker's "complex" example
-         It should change in future versions */
+    /* OK the rest is largerly put in here to mimick Steve Baker's
+       "complex" example It should change in future versions */
       
-      timerText = new puText (300, 10);
-      timerText -> setColour (PUCOL_LABEL, 1.0, 1.0, 1.0);
-
-      /* Make a button to hide the menu bar */
-      hideMenuButton = new puButton       (10,10, 150, 50);
-      hideMenuButton -> setValue          (TRUE);
-      hideMenuButton -> setLegend         ("Hide Menu");
-      hideMenuButton -> setCallback       (hideMenuCb);
-      hideMenuButton -> makeReturnDefault (TRUE);
-      hideMenuButton -> hide();
-
-      // Make the menu bar
-      mainMenuBar = new puMenuBar ();
-      mainMenuBar -> add_submenu ("File", fileSubmenu, fileSubmenuCb);
-      mainMenuBar -> add_submenu ("Edit", editSubmenu, editSubmenuCb);
-      mainMenuBar -> add_submenu ("View", viewSubmenu, viewSubmenuCb);
-      mainMenuBar -> add_submenu ("Aircraft", aircraftSubmenu, aircraftSubmenuCb);
-      mainMenuBar -> add_submenu ("Environment", environmentSubmenu, environmentSubmenuCb);
-      mainMenuBar -> add_submenu ("Options", optionsSubmenu, optionsSubmenuCb);
-      mainMenuBar -> add_submenu ("Help", helpSubmenu, helpSubmenuCb);
-      mainMenuBar-> close ();
+    timerText = new puText (300, 10);
+    timerText -> setColour (PUCOL_LABEL, 1.0, 1.0, 1.0);
+
+    /* Make a button to hide the menu bar */
+    hideMenuButton = new puButton       (10,10, 150, 50);
+    hideMenuButton -> setValue          (TRUE);
+    hideMenuButton -> setLegend         ("Hide Menu");
+    hideMenuButton -> setCallback       (hideMenuCb);
+    hideMenuButton -> makeReturnDefault (TRUE);
+    hideMenuButton -> hide();
+
+    // Make the menu bar
+    mainMenuBar = new puMenuBar ();
+    mainMenuBar -> add_submenu ("File", fileSubmenu, fileSubmenuCb);
+    mainMenuBar -> add_submenu ("Edit", editSubmenu, editSubmenuCb);
+    mainMenuBar -> add_submenu ("View", viewSubmenu, viewSubmenuCb);
+    mainMenuBar -> add_submenu ("Aircraft", aircraftSubmenu, aircraftSubmenuCb);
+    mainMenuBar -> add_submenu ("Environment", environmentSubmenu, 
+                               environmentSubmenuCb);
+    mainMenuBar -> add_submenu ("Options", optionsSubmenu, optionsSubmenuCb);
+    mainMenuBar -> add_submenu ("Help", helpSubmenu, helpSubmenuCb);
+    mainMenuBar-> close ();
 }
-
-
-
-
-
-
-