00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef _VRJ_GLX_WIN_H
00034 #define _VRJ_GLX_WIN_H
00035
00036
00037 #include <vrj/vrjConfig.h>
00038 #include <vector>
00039
00040 #include <X11/Xlib.h>
00041 #include <X11/Xutil.h>
00042 #include <GL/glx.h>
00043
00044 #include <vrj/Draw/OGL/GlWindow.h>
00045 #include <gadget/Devices/EventWindow/EventWindowXWin.h>
00046
00047
00048 namespace vrj
00049 {
00050
00051 class Display;
00052
00054 typedef struct
00055 {
00056 #define MWM_HINTS_DECORATIONS 2
00057 long flags;
00058 long functions;
00059 long decorations;
00060 long input_mode;
00061 }
00062 MotifWmHints;
00063
00064
00069 class GlWindowXWin: public vrj::GlWindow, public gadget::EventWindowXWin
00070 {
00071 public:
00072 GlWindowXWin();
00073 virtual ~GlWindowXWin();
00074
00075 void swapBuffers();
00076 int open();
00077 int close();
00078 bool makeCurrent();
00079
00083 virtual void checkEvents();
00084
00085 void configWindow(vrj::Display* disp);
00086
00087 public:
00088 virtual bool createHardwareSwapGroup(std::vector<vrj::GlWindow*> wins);
00089
00090 protected:
00091
00092 ::XVisualInfo* getGlxVisInfo(::Display* display, int screen);
00093
00100 static int EventIsMapNotify(::Display* display, ::XEvent* e, ::XPointer window);
00101
00106 virtual void processEvent(XEvent event);
00107
00108 private:
00109 ::Display* mXDisplay;
00110 ::XVisualInfo* mVisualInfo;
00111 ::GLXContext mGlxContext;
00112 ::Window mXWindow;
00113 std::string mWindowName;
00114 int mPipe;
00115 std::string mXDisplayName;
00116 };
00117
00118
00119 }
00120 #endif