Klamp't  0.9.0
GLUTGUI.h
1 #ifndef INTERFACE_GLUT_GUI_H
2 #define INTERFACE_GLUT_GUI_H
3 
4 #include <KrisLibrary/GLdraw/GLUTProgram.h>
5 #include "GenericGUI.h"
6 
7 namespace Klampt {
8 
9 class GLUTGUI : public GenericGUIBase, public GLUTProgramBase
10 {
11  public:
12  GLUTGUI(GenericBackendBase* backend=NULL,int w=800,int h=600);
13  virtual ~GLUTGUI() {}
14  //if you want to set up the window title, it must be called before Run()
15  void SetWindowTitle(const char* title) { window_title = title; }
16  //if you want to set up the display mode, it must be called before Run()
17  void SetDisplayMode(int mode) { displayMode = mode; }
18 
20  virtual bool Initialize();
21  virtual void Handle_Display();
22  virtual void Handle_Reshape(int w,int h);
23  virtual void Handle_Keypress(unsigned char key,int x,int y);
24  virtual void Handle_KeypressUp(unsigned char key,int x,int y);
25  virtual void Handle_Special(int key,int x,int y);
26  virtual void Handle_SpecialUp(int key,int x,int y);
27  virtual void Handle_Click(int button,int state,int x,int y);
28  virtual void Handle_Drag(int x,int y);
29  virtual void Handle_Motion(int x,int y);
30  virtual void Handle_Idle();
31 
32  virtual void Run();
33  virtual bool OnQuit();
34  virtual bool OnNotify(const string& text,const string& msglevel);
35  virtual bool OnPauseIdle(double secs);
36  virtual bool OnRefresh();
37  virtual bool OnDrawText(double x, double y, double z, const std::string &text, int height);
38  virtual bool OnDrawText(int x, int y, const std::string &text, int height);
39 
40  string window_title;
41  unsigned int displayMode;
42 };
43 
44 } //namespace Klampt
45 
46 #endif
Definition: GLUTGUI.h:9
Definition: GenericGUI.h:86
A base class for a GUI frontend. Performs message passing to the backend in the easily serializable A...
Definition: GenericGUI.h:27
virtual bool Initialize()
Subclasses: put GL initialization code here.
virtual void Run()
Default implementation does nothing but startup and shutdown the interface.
Definition: ContactDistance.h:6