00001 #ifndef fl_gl_h 00002 #define fl_gl_h 00003 00004 00005 #include "fl/glx.h" 00006 00007 // This header does not directly require keysym.h, but it makes using 00008 // GLShow easier for the developer. 00009 #include <X11/keysym.h> 00010 00011 00012 namespace fl 00013 { 00014 class GLShow : public GLXWindow 00015 { 00016 public: 00017 GLShow (int width = 400, int height = 400); // Figure out everything automatically 00018 ~GLShow (); 00019 00020 virtual bool processEvent (XEvent & event); 00021 00022 void waitForClose (); // Current thread goes to sleep, and returns once this winodw is destroyed. 00023 void stopWaiting (); // Releases all threads waiting on this window. Presumably one of these threads will then destroy this object. 00024 00025 virtual void initContext (); // One-time initialization of GL context. 00026 virtual void reshape (int width, int height); // Called when window is first constructed and each time its shape changes. 00027 virtual void display (); // Called when part of the window needs to be repainted. 00028 virtual void drag (int toX, int toY, unsigned int state); // Called during mouse drags. 00029 virtual void click (int x, int y, unsigned int state); // Called when mouse button releases w/o intervening drag. 00030 virtual void keyboard (KeySym keysym); // Called when a keystroke occurs. 00031 00032 00033 fl::GLXContext context; 00034 bool contextInitialized; 00035 00036 Atom WM_DELETE_WINDOW; 00037 Atom WM_PROTOCOLS; // For some reason, this isn't defined in Xatom.h 00038 00039 bool dragMode; 00040 int lastX; // Where the last button event occurred 00041 int lastY; 00042 00043 pthread_mutex_t waitingMutex; 00044 pthread_cond_t waitingCondition; 00045 }; 00046 } 00047 00048 00049 #endif
1.2.18