mod_sim::ModuleSimGui Class Reference

Module GUI screens. More...

#include <mod_sim_gui.hh>

List of all members.

Public Member Functions

 ModuleSimGui (void)
 ~ModuleSimGui ()
void Init (void)
void Delete (void)
void Reset (void)
void Draw (void)
void Reshape (const Rect< int > &viewport, const Rect< int > &window)
void SplashOff (void)
void SetZoom (const fp zoom)
fp GetZoom (void)
void IncZoom (void)
void DecZoom (void)
void ToggleBlend (void)
void ToggleMenu (void)
void PrintStatus (const char *str)
void Update (void)
void UpdatePause (void)
void UpdateInputDevice (void)
void UpdateJoystickAxis3 (void)
void UpdateJoycal (void)
void UpdatePerspective (void)
void UpdateFogDensity (void)
void UpdateCollisions (void)
void UpdateControlResponse (void)
void UpdateLod (void)
void UpdateGuiZoom (void)
bool IfAnyMouseButtonPressed (void)
void TimerOneSecond (void)
void MouseMotionHandler (fp x, fp y)
void MouseButtonHandler (eMouseEvent button, bool down)

Private Member Functions

void StartStopListeners (bool start)
void InitScreens (void)
void InitScreenMain (void)
void InitScreenMenu (void)
void InitScreenHelp (void)
void InitScreenAbout (void)
void InitScreenJoycal (void)
void DrawScreens (void)
void DrawScreenMain (void)
void DrawScreenMenu (void)
void DrawScreenHelp (void)
void DrawScreenAbout (void)
void DrawScreenJoycal (void)
void DrawEasterEgg (void)
void GuiButtonCallback (GuiObject *obj, uint buttons)
void WriteJoycalConfig (GuiButton *button, const char *str, int val, const string &key)
void ResetJoycalConfig (void)
void TurnScreensOff (GuiScreen *notme)
void UpdateDebug (void)
void UpdateDebugWireframe (void)
void UpdateDebugNormals (void)
void UpdateDebugDrawBSPVolume (void)
void UpdateDebugDrawObjectVolume (void)
void InitScreenDebug (void)
void DrawScreenDebug (void)
void ToggleDebug (void)

Private Attributes

bool mInit
bool mReady
bool mAfterSplash
bool mMouseButtonWasPressed
bool mAboutButtonWasToggled
GuimGui
GuiScreenmScreenMain
GuiScreenmScreenMenu
GuiScreenmScreenHelp
GuiScreenmScreenAbout
GuiScreenmScreenJoycal
GuiButtonmButtonMenu
GuiButtonmButtonPause
GuiButtonmButtonExit
GuiButtonmButtonSave
GuiButtonmButtonHelp
GuiButtonmButtonAbout
GuiButtonmButtonCollisions
GuiButtonmButtonLod
GuiButtonmButtonGuiZoomPlus
GuiButtonmButtonGuiZoomMinus
GuiButtonmButtonPerspectivePlus
GuiButtonmButtonPerspectiveMinus
GuiButtonmButtonFogDensityPlus
GuiButtonmButtonFogDensityMinus
GuiButtonmButtonResponsePlus
GuiButtonmButtonResponseMinus
GuiButtonmButtonInputDevice
GuiButtonmButtonJoyaxis3
GuiButtonmButtonJoycal
GuiButtonmButtonJoycalReset
GuiButtonmButtonJoycalLeftMax
GuiButtonmButtonJoycalLeftMin
GuiButtonmButtonJoycalRightMax
GuiButtonmButtonJoycalRightMin
GuiButtonmButtonJoycalUpMax
GuiButtonmButtonJoycalUpMin
GuiButtonmButtonJoycalDownMax
GuiButtonmButtonJoycalDownMin
GuiButtonmButtonJoycalSlowMax
GuiButtonmButtonJoycalSlowMin
GuiButtonmButtonJoycalFastMax
GuiButtonmButtonJoycalFastMin
GuiScreenmScreenDebug
GuiButtonmButtonDebug
GuiButtonmButtonDebugWireframe
GuiButtonmButtonDebugNormals
GuiButtonmButtonDebugDrawBSPVolume
GuiButtonmButtonDebugDrawObjectVolume
vector< fpmDrawNormalScales

Friends

void ModuleSimGui_GuiButtonCallback (GuiObject *obj, uint buttons)


Detailed Description

Module GUI screens.

Race-condition at startup: Input queue should be kept disabled until GUI is ready, since possibly a stray mouse button or keyboard event could lead to call a GUI method before the GUI is ready.


Constructor & Destructor Documentation

mod_sim::ModuleSimGui::ModuleSimGui ( void   ) 

ctor/dtor. This must be a single PERSISTENT object! This NOP constructor relies on the object being PERSISTENT to auto-zero all members.

mod_sim::ModuleSimGui::~ModuleSimGui (  ) 


Member Function Documentation

void mod_sim::ModuleSimGui::Init ( void   ) 

Initialize GUI.

void mod_sim::ModuleSimGui::Delete ( void   ) 

void mod_sim::ModuleSimGui::Reset ( void   ) 

Reset GUI.

void mod_sim::ModuleSimGui::Draw ( void   ) 

Draw the GUI.

void mod_sim::ModuleSimGui::Reshape ( const Rect< int > &  viewport,
const Rect< int > &  window 
)

Handler window reshape event.

void mod_sim::ModuleSimGui::SplashOff ( void   ) 

Tell GUI when the first keyboard press or mouse click occurs. Used to clear the splash screen.

void mod_sim::ModuleSimGui::SetZoom ( const fp  zoom  ) 

fp mod_sim::ModuleSimGui::GetZoom ( void   ) 

void mod_sim::ModuleSimGui::IncZoom ( void   ) 

Inc/dec zoom.

void mod_sim::ModuleSimGui::DecZoom ( void   ) 

void mod_sim::ModuleSimGui::ToggleBlend ( void   ) 

void mod_sim::ModuleSimGui::ToggleMenu ( void   ) 

Misc. GUI public functions. These interface functions can safely called before the GUI is even constructed.

void mod_sim::ModuleSimGui::PrintStatus ( const char *  str  ) 

Print a status message to the GUI.

void mod_sim::ModuleSimGui::Update ( void   ) 

Dual-purpose functions used to initialize GUI objects and/or to tell the GUI to update itself to a change. Some of these functions are used in interaction between the keyboard and GUI as some keys and buttons control the same settings.

NOTE: Pointers to screens and other GUI objects should be checked for NULL because during initialization some GUI objects are created before others are. Some of the same Gui*() functions are reused to initialize a GUI object and also to synchronize with other GUI objects (hence the need to check for NULL). During initialization, if a pointer is NULL, an action is skipped but it'll be done later as that nonexistent object will eventually be initialized.

[historical:] A busy flag is used to prevent possible infinite recursion in case GUI method A calls B and B calls A.

void mod_sim::ModuleSimGui::UpdatePause ( void   ) 

void mod_sim::ModuleSimGui::UpdateInputDevice ( void   ) 

void mod_sim::ModuleSimGui::UpdateJoystickAxis3 ( void   ) 

void mod_sim::ModuleSimGui::UpdateJoycal ( void   ) 

void mod_sim::ModuleSimGui::UpdatePerspective ( void   ) 

void mod_sim::ModuleSimGui::UpdateFogDensity ( void   ) 

void mod_sim::ModuleSimGui::UpdateCollisions ( void   ) 

void mod_sim::ModuleSimGui::UpdateControlResponse ( void   ) 

void mod_sim::ModuleSimGui::UpdateLod ( void   ) 

void mod_sim::ModuleSimGui::UpdateGuiZoom ( void   ) 

bool mod_sim::ModuleSimGui::IfAnyMouseButtonPressed ( void   )  [inline]

void mod_sim::ModuleSimGui::TimerOneSecond ( void   ) 

This should be pulsed by a timer-tick. See gfx_gui.hh.

void mod_sim::ModuleSimGui::MouseMotionHandler ( fp  x,
fp  y 
)

This should be called by the gfx mouse motion handler. See gfx_gui.hh.

void mod_sim::ModuleSimGui::MouseButtonHandler ( eMouseEvent  button,
bool  down 
)

This should be called by the gfx mouse motion handler. See gfx_gui.hh.

void mod_sim::ModuleSimGui::StartStopListeners ( bool  start  )  [private]

void mod_sim::ModuleSimGui::InitScreens ( void   )  [private]

Create all screens.

void mod_sim::ModuleSimGui::InitScreenMain ( void   )  [private]

Create main screen.

void mod_sim::ModuleSimGui::InitScreenMenu ( void   )  [private]

Create menu screen.

void mod_sim::ModuleSimGui::InitScreenHelp ( void   )  [private]

Initialize Help screen.

void mod_sim::ModuleSimGui::InitScreenAbout ( void   )  [private]

Initialize About screen.

void mod_sim::ModuleSimGui::InitScreenJoycal ( void   )  [private]

Create joystick calibration screen (never visible if no joystick).

void mod_sim::ModuleSimGui::DrawScreens ( void   )  [private]

Draw GUI screens.

void mod_sim::ModuleSimGui::DrawScreenMain ( void   )  [private]

Draw main screen.

void mod_sim::ModuleSimGui::DrawScreenMenu ( void   )  [private]

Draw menu screen.

void mod_sim::ModuleSimGui::DrawScreenHelp ( void   )  [private]

Draw help screen

void mod_sim::ModuleSimGui::DrawScreenAbout ( void   )  [private]

Print About. This is drawn during startup so it needs to be independent/self-contained. Calling certain query methods such as Engine::IfReady() is safe any time.

void mod_sim::ModuleSimGui::DrawScreenJoycal ( void   )  [private]

Draw the screen for calibrating a joystick.

How this works:

The various joystick values are shown in one column. "?????" is shown until the user moves the joystick to give it a value and corresponding button is set insensitive until the value is valid. The user can move the joystick in the various directions, then when the user finds a value acceptable, the user can click the now sensitive button which stores the value in the config file.

void mod_sim::ModuleSimGui::DrawEasterEgg ( void   )  [private]

Easter Egg activated when ABOUT screen is shown.

void mod_sim::ModuleSimGui::GuiButtonCallback ( GuiObject obj,
uint  buttons 
) [private]

void mod_sim::ModuleSimGui::WriteJoycalConfig ( GuiButton button,
const char *  str,
int  val,
const string &  key 
) [private]

Write a joystick axis value to config file.

void mod_sim::ModuleSimGui::ResetJoycalConfig ( void   )  [private]

Reset joystick calibration to default values.

void mod_sim::ModuleSimGui::TurnScreensOff ( GuiScreen notme  )  [private]

Turn screens off except the one passed.

void mod_sim::ModuleSimGui::UpdateDebug ( void   )  [private]

void mod_sim::ModuleSimGui::UpdateDebugWireframe ( void   )  [private]

void mod_sim::ModuleSimGui::UpdateDebugNormals ( void   )  [private]

void mod_sim::ModuleSimGui::UpdateDebugDrawBSPVolume ( void   )  [private]

void mod_sim::ModuleSimGui::UpdateDebugDrawObjectVolume ( void   )  [private]

void mod_sim::ModuleSimGui::InitScreenDebug ( void   )  [private]

Initialize Debug screen.

void mod_sim::ModuleSimGui::DrawScreenDebug ( void   )  [private]

Draw Debug screen.

void mod_sim::ModuleSimGui::ToggleDebug ( void   )  [private]


Friends And Related Function Documentation

void ModuleSimGui_GuiButtonCallback ( GuiObject obj,
uint  buttons 
) [friend]

Called by underlying gfx Gui class when a Gui button was clicked.


Member Data Documentation

bool mod_sim::ModuleSimGui::mInit [private]

bool mod_sim::ModuleSimGui::mReady [private]

bool mod_sim::ModuleSimGui::mAfterSplash [private]

bool mod_sim::ModuleSimGui::mMouseButtonWasPressed [private]

bool mod_sim::ModuleSimGui::mAboutButtonWasToggled [private]

Gui* mod_sim::ModuleSimGui::mGui [private]

GuiScreen* mod_sim::ModuleSimGui::mScreenMain [private]

GuiScreen* mod_sim::ModuleSimGui::mScreenMenu [private]

GuiScreen* mod_sim::ModuleSimGui::mScreenHelp [private]

GuiScreen* mod_sim::ModuleSimGui::mScreenAbout [private]

GuiScreen* mod_sim::ModuleSimGui::mScreenJoycal [private]

GuiButton* mod_sim::ModuleSimGui::mButtonMenu [private]

GuiButton* mod_sim::ModuleSimGui::mButtonPause [private]

GuiButton* mod_sim::ModuleSimGui::mButtonExit [private]

GuiButton* mod_sim::ModuleSimGui::mButtonSave [private]

GuiButton* mod_sim::ModuleSimGui::mButtonHelp [private]

GuiButton* mod_sim::ModuleSimGui::mButtonAbout [private]

GuiButton* mod_sim::ModuleSimGui::mButtonCollisions [private]

GuiButton* mod_sim::ModuleSimGui::mButtonLod [private]

GuiButton* mod_sim::ModuleSimGui::mButtonGuiZoomPlus [private]

GuiButton* mod_sim::ModuleSimGui::mButtonGuiZoomMinus [private]

GuiButton* mod_sim::ModuleSimGui::mButtonPerspectivePlus [private]

GuiButton* mod_sim::ModuleSimGui::mButtonPerspectiveMinus [private]

GuiButton* mod_sim::ModuleSimGui::mButtonFogDensityPlus [private]

GuiButton* mod_sim::ModuleSimGui::mButtonFogDensityMinus [private]

GuiButton* mod_sim::ModuleSimGui::mButtonResponsePlus [private]

GuiButton* mod_sim::ModuleSimGui::mButtonResponseMinus [private]

GuiButton* mod_sim::ModuleSimGui::mButtonInputDevice [private]

GuiButton* mod_sim::ModuleSimGui::mButtonJoyaxis3 [private]

GuiButton* mod_sim::ModuleSimGui::mButtonJoycal [private]

GuiButton* mod_sim::ModuleSimGui::mButtonJoycalReset [private]

GuiButton* mod_sim::ModuleSimGui::mButtonJoycalLeftMax [private]

GuiButton* mod_sim::ModuleSimGui::mButtonJoycalLeftMin [private]

GuiButton* mod_sim::ModuleSimGui::mButtonJoycalRightMax [private]

GuiButton* mod_sim::ModuleSimGui::mButtonJoycalRightMin [private]

GuiButton* mod_sim::ModuleSimGui::mButtonJoycalUpMax [private]

GuiButton* mod_sim::ModuleSimGui::mButtonJoycalUpMin [private]

GuiButton* mod_sim::ModuleSimGui::mButtonJoycalDownMax [private]

GuiButton* mod_sim::ModuleSimGui::mButtonJoycalDownMin [private]

GuiButton* mod_sim::ModuleSimGui::mButtonJoycalSlowMax [private]

GuiButton* mod_sim::ModuleSimGui::mButtonJoycalSlowMin [private]

GuiButton* mod_sim::ModuleSimGui::mButtonJoycalFastMax [private]

GuiButton* mod_sim::ModuleSimGui::mButtonJoycalFastMin [private]

GuiScreen* mod_sim::ModuleSimGui::mScreenDebug [private]

GuiButton* mod_sim::ModuleSimGui::mButtonDebug [private]

GuiButton* mod_sim::ModuleSimGui::mButtonDebugWireframe [private]

GuiButton* mod_sim::ModuleSimGui::mButtonDebugNormals [private]

GuiButton* mod_sim::ModuleSimGui::mButtonDebugDrawBSPVolume [private]

GuiButton* mod_sim::ModuleSimGui::mButtonDebugDrawObjectVolume [private]

vector<fp> mod_sim::ModuleSimGui::mDrawNormalScales [private]


The documentation for this class was generated from the following files: Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:30 2007