From e3cd2005badc253dfba6ea5cc1776fe73bd512a7 Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 4 Jul 1998 00:48:41 +0000 Subject: [PATCH] Check for full screen (no windows system support) before having PUI draw 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 | 92 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 54 insertions(+), 38 deletions(-) diff --git a/GUI/gui.cxx b/GUI/gui.cxx index 9d1099974..84a20aafb 100644 --- a/GUI/gui.cxx +++ b/GUI/gui.cxx @@ -22,8 +22,14 @@ * (Log is kept at end of this file) **************************************************************************/ + +#include +#include + +#include + #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 (); } - - - - - - - -- 2.39.2