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
00034 #ifdef G4VIS_BUILD_OPENGLX_DRIVER
00035
00036 #ifndef G4OPENGLXVIEWER_HH
00037 #define G4OPENGLXVIEWER_HH
00038
00039 #include "G4OpenGLViewer.hh"
00040 #include "globals.hh"
00041
00042 #include <X11/Intrinsic.h>
00043
00044 #include "G4OpenGL.hh"
00045 #include <GL/glx.h>
00046
00047 class G4OpenGLSceneHandler;
00048 class G4Text;
00049
00050 class G4OpenGLXViewer: virtual public G4OpenGLViewer {
00051
00052 friend class G4OpenGLXViewerMessenger;
00053 friend class G4OpenGLXmViewer;
00054
00055 public:
00056 G4OpenGLXViewer (G4OpenGLSceneHandler& scene);
00057 virtual ~G4OpenGLXViewer ();
00058 void SetView ();
00059 void ShowView ();
00060 void DrawText(const G4Text&);
00061
00062 protected:
00063 void GetXConnection ();
00064 void CreateGLXContext (XVisualInfo* vi);
00065 virtual void CreateMainWindow ();
00066 virtual void CreateFontLists ();
00067
00068 static int snglBuf_RGBA[12];
00069 static int dblBuf_RGBA[13];
00070
00072
00073 XWindowAttributes xwa;
00074 Display *dpy;
00075 static XVisualInfo *vi_single_buffer;
00076 static XVisualInfo *vi_double_buffer;
00077 XVisualInfo *vi_immediate,
00078 *vi_stored,
00079 *vi;
00080 Colormap cmap;
00081 XSetWindowAttributes swa;
00082 GLXDrawable win;
00083 GLXContext cx;
00084 XEvent event;
00085 G4int *attributeList,
00086 errorBase,
00087 eventBase,
00088 major,
00089 minor;
00090 XSizeHints *norm_hints;
00091 XWMHints *wm_hints;
00092 XClassHint *class_hints;
00093 Pixmap icon_pixmap;
00094 XSizeHints *size_hints;
00095 Atom Xatom;
00096 XTextProperty windowName,
00097 iconName;
00098 char charViewName [100];
00099
00100
00101 private:
00102 G4OpenGLXViewer (const G4OpenGLXViewer&);
00103 G4OpenGLXViewer& operator = (const G4OpenGLXViewer&);
00104 GLXContext tmp_cx;
00105 };
00106
00107 #endif
00108
00109 #endif