Klamp't  0.8.1
4 #include "GenericGUI.h"
5 #include <KrisLibrary/GLdraw/GLUIProgram.h>
7 class GLUI_Control;
18 class GLUIGUI : public GenericGUIBase, public GLUIProgramBase
19 {
20  public:
21  GLUIGUI(GenericBackendBase* backend=NULL,int w=800,int h=600);
22  virtual ~GLUIGUI() {}
23  //if you want to set up the window title, it must be called before Run()
24  void SetWindowTitle(const char* title) { window_title = title; }
25  //if you want to set up the display mode, it must be called before Run()
26  void SetDisplayMode(int mode) { displayMode = mode; }
29  virtual bool Initialize();
33  virtual void Handle_Control(int id);
34  virtual void Handle_Display();
35  virtual void Handle_Reshape(int w,int h);
36  virtual void Handle_Keypress(unsigned char key,int x,int y);
37  virtual void Handle_KeypressUp(unsigned char key,int x,int y);
38  virtual void Handle_Special(int key,int x,int y);
39  virtual void Handle_SpecialUp(int key,int x,int y);
40  virtual void Handle_Click(int button,int state,int x,int y);
41  virtual void Handle_Drag(int x,int y);
42  virtual void Handle_Motion(int x,int y);
43  virtual void Handle_Idle();
52  int AddControl(GLUI_Control*,const char* name=NULL);
54  virtual void Run();
55  virtual bool OnQuit();
56  virtual bool OnNotify(const string& text,const string& msglevel);
57  virtual bool OnPauseIdle(double secs);
58  virtual bool OnRefresh();
59  virtual bool OnResize(int w,int h);
60  virtual bool OnDrawText(double x, double y, double z, const std::string &text, int height);
61  virtual bool OnDrawText(int x, int y, const std::string &text, int height);
63  string window_title;
64  unsigned int displayMode;
65  vector<GLUI_Control*> controls;
66  vector<string> controlNames;
67 };
70 #endif
int AddControl(GLUI_Control *, const char *name=NULL)
A base class for GLUI GUIs.
Definition: GLUIGUI.h:18
virtual bool Initialize()
Subclasses: put GL initialization code here.
virtual void Run()
Default implementation does nothing but startup and shutdown the interface.
virtual void Handle_Control(int id)
A base class for a GUI frontend. Performs message passing to the backend in the easily serializable A...
Definition: GenericGUI.h:25
Definition: GenericGUI.h:84