gfx_gui.hh File Reference

Simple lightweight GUI inside of a viewport. Provides GUI objects such as text fonts, buttons, etc. GUI objects are drawn blended over prior drawing. More...

#include "gfx_rgba.hh"
#include "gfx_font.hh"
#include "gfx_gfxsys.hh"
#include "gfx_gui_opengl.hh"

Go to the source code of this file.

Namespaces

namespace  gfx

Classes

class  gfx::Gfont
 Gfont is a wrapper around underlying lower-level Font class. More...
class  gfx::GuiBase
 GUI base class. More...
class  gfx::PrintDesc
 Parameter struct for GuiScreen::PrintTimer(). More...
class  gfx::GuiScreen
 Screen class. More...
class  gfx::GuiObject
 GUI object base class. More...
class  gfx::GuiPrint
 Used for messages that expire. Not for regular Print(). More...
class  gfx::GuiButtonBase
 Button base class. More...

Defines

#define GFX_GUI_HH   1

Typedefs

typedef void(* gfx::fnMouseButtonCallback )(GuiObject *obj, uint buttons)

Enumerations

enum  gfx::eScreenFontType { gfx::eScreenFontType_NORMAL, gfx::eScreenFontType_THIN }
enum  gfx::eScreenFontSize {
  gfx::eScreenFontSize_SMALLEST, gfx::eScreenFontSize_SMALLER, gfx::eScreenFontSize_SMALL, gfx::eScreenFontSize_NORMAL,
  gfx::eScreenFontSize_LARGE, gfx::eScreenFontSize_LARGER, gfx::eScreenFontSize_LARGEST
}
enum  gfx::eMouseEvent {
  gfx::eMouseEvent_NONE = 0, gfx::eMouseEvent_MOTION_ENTER = (1<<0), gfx::eMouseEvent_MOTION_EXIT = (1<<1), gfx::eMouseEvent_BUTTON_1 = (1<<2),
  gfx::eMouseEvent_BUTTON_2 = (1<<3), gfx::eMouseEvent_BUTTON_3 = (1<<4), gfx::eMouseEvent_BUTTON_MASK = (eMouseEvent_BUTTON_1|eMouseEvent_BUTTON_2|eMouseEvent_BUTTON_3)
}
enum  gfx::eGuiObject { gfx::eGuiObject_INVALID, gfx::eGuiObject_BASE, gfx::eGuiObject_PRINT, gfx::eGuiObject_BUTTON }

Variables

const uint gfx::GUIBASE_PUSH_FONT_SOFT_LIMIT = 30


Detailed Description

Simple lightweight GUI inside of a viewport. Provides GUI objects such as text fonts, buttons, etc. GUI objects are drawn blended over prior drawing.

Id
LastChangedDate

Author:
Jim E. Brooks http://www.palomino3d.org
 *
 * To bring-up the GUI:
 * --------------------
 *
 * 1. Construct a Gui object.
 * 2. Your application must call Gui::TimerOneSecond() (see note).
 * 3. Your application must handle mouse events and pass them to Gui::MouseEvent().
 * 4. Add a call to Gui::ReshapeViewport() in your system-specific (eg OpenGL)
 *    reshape function so that the GUI object can adjust accordingly.
 * 5. Add a call to Gui::Draw() in your system-specific drawing routine
 *    to draw the GUI.  The call should be one of the last drawing commands
 *    so that the GUI will appear over everything else.
 * 6. Call GUI::NewScreen() (not GuiScreen::GuiScreen() ) to make a new screen.
 *    A "screen" is just a set of GUI components that are blended over the viewport.
 *    Screens can be flipped like pages in a book, and multiple screens can be
 *    shown at the same time (overlay).
 *
 * Notes:
 * ------
 * Timer management is delegated to the application.  This class doesn't use
 * its own timer.  The reason is that multiple timers would very likely cause
 * concurrency issues.  On OpenGL, using a single timer is strongly suggested.
 *
 * To use GUI objects:
 * -------------------
 *
 * 1. Construct GUI objects via a GuiScreen object rather than directly.
 *    The reasoning is that GUI objects belong to and are managed by
 *    a GuiScreen object.  Eg, to make a new button, call GuiScreen::NewButton().
 *
 * Screens:
 * --------
 *
 * A screen's visibility can be changed by GuiScreen::SetVisi().
 * If the screen isn't visible, none of its objects will be drawn.
 * Multiple screens are allowed to be visible at the same time.
 *
 * Printing in a screen:
 * ---------------------
 *
 * In your draw routine, put calls to GuiScreen::Print() to display text.
 * Print() must be called every frame.
 *
 * However, GuiScreen::PrintTimer() is intended to be called once.  Thereafter,
 * the GuiScreen class will automatically print it until its timer expires.
 *
 * GuiScreen::Push/PopPrint() are provided to facilitate changing fonts while printing.
 * PushPrint() is a push-then-change operation.
 *
 *    MyDrawMainRoutine()
 *    {
 *       screen->PushPrint();
 *          screen->Print(); [...]
 *          ...
 *          MyDrawSubroutine1();
 *          MyDrawSubroutine2();
 *          ...
 *       screen->PopPrint();
 *    }
 *
 *    MyDrawSubroutine1()
 *    {
 *       screen->PushPrint();
 *          screen->Print();
 *       screen->PopPrint();
 *    }
 *
 * Buttons:
 * --------
 *
 * A callback is called whenever a GuiButton is clicked.
 * Your callback can call GuiButton::SetText() to change
 * the text shown in the button.
 *
 * 

Define Documentation

#define GFX_GUI_HH   1

Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:15 2007