1
0
Fork 0

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.
This commit is contained in:
curt 1998-07-04 00:48:41 +00:00
parent 3a6278c4e0
commit e3cd2005ba

View file

@ -22,8 +22,14 @@
* (Log is kept at end of this file) * (Log is kept at end of this file)
**************************************************************************/ **************************************************************************/
#include <stdlib.h>
#include <string.h>
#include <Include/general.h>
#include "gui.h" #include "gui.h"
#define USING_3DFX
puMenuBar *mainMenuBar; puMenuBar *mainMenuBar;
puButton *hideMenuButton; puButton *hideMenuButton;
@ -125,43 +131,53 @@ puCallback helpSubmenuCb [] = { notCb, notCb, NULL };
void guiInit() void guiInit()
{ {
puInit(); fgGENERAL *g;
#ifdef USING_3DFX char *mesa_win_state;
puShowCursor ();
#endif
// 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 */
timerText = new puText (300, 10);
timerText -> setColour (PUCOL_LABEL, 1.0, 1.0, 1.0);
/* Make a button to hide the menu bar */ g = &general;
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 // Initialize PUI
mainMenuBar = new puMenuBar (); puInit();
mainMenuBar -> add_submenu ("File", fileSubmenu, fileSubmenuCb);
mainMenuBar -> add_submenu ("Edit", editSubmenu, editSubmenuCb); // Determine if we need to render the cursor, or if the windowing
mainMenuBar -> add_submenu ("View", viewSubmenu, viewSubmenuCb); // system will do it. First test if we are rendering with glide.
mainMenuBar -> add_submenu ("Aircraft", aircraftSubmenu, aircraftSubmenuCb); if ( strstr ( g->glRenderer, "Glide" ) ) {
mainMenuBar -> add_submenu ("Environment", environmentSubmenu, environmentSubmenuCb); // Test for the MESA_GLX_FX env variable
mainMenuBar -> add_submenu ("Options", optionsSubmenu, optionsSubmenuCb); if ( (mesa_win_state = getenv( "MESA_GLX_FX" )) != NULL) {
mainMenuBar -> add_submenu ("Help", helpSubmenu, helpSubmenuCb); // test if we are fullscreen mesa/glide
mainMenuBar-> close (); 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 */
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 ();
} }