File indexing completed on 2025-01-18 09:58:48
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #ifndef G4OPENGLXVIEWER_HH
0034 #define G4OPENGLXVIEWER_HH
0035
0036 #include "G4OpenGLViewer.hh"
0037 #include "globals.hh"
0038
0039 #include <X11/Intrinsic.h>
0040
0041 #include "G4OpenGL.hh"
0042 #include <GL/glx.h>
0043
0044 class G4OpenGLSceneHandler;
0045 class G4Text;
0046
0047 class G4OpenGLXViewer: virtual public G4OpenGLViewer {
0048
0049 friend class G4OpenGLXViewerMessenger;
0050 friend class G4OpenGLXmViewer;
0051
0052 public:
0053 G4OpenGLXViewer (G4OpenGLSceneHandler& scene);
0054 virtual ~G4OpenGLXViewer ();
0055 void SetView ();
0056 void ShowView ();
0057 #ifdef G4MULTITHREADED
0058 void SwitchToVisSubThread();
0059 void SwitchToMasterThread();
0060 #endif
0061 void DrawText(const G4Text&);
0062
0063 protected:
0064 void GetXConnection ();
0065 void CreateGLXContext (XVisualInfo* vi);
0066 virtual void CreateMainWindow ();
0067 virtual void CreateFontLists ();
0068
0069 static int snglBuf_RGBA[12];
0070 static int dblBuf_RGBA[13];
0071
0072
0073
0074 XWindowAttributes xwa;
0075 Display *dpy;
0076 static XVisualInfo *vi_single_buffer;
0077 static XVisualInfo *vi_double_buffer;
0078 XVisualInfo *vi_immediate,
0079 *vi_stored,
0080 *vi;
0081 Colormap cmap;
0082 XSetWindowAttributes swa;
0083 GLXDrawable win;
0084 GLXContext cxMaster;
0085 #ifdef G4MULTITHREADED
0086 GLXContext cxVisSubThread;
0087 #endif
0088 XEvent event;
0089 G4int *attributeList,
0090 errorBase,
0091 eventBase,
0092 major,
0093 minor;
0094 XSizeHints *norm_hints;
0095 XWMHints *wm_hints;
0096 XClassHint *class_hints;
0097 Pixmap icon_pixmap;
0098 XSizeHints *size_hints;
0099 Atom Xatom;
0100 XTextProperty windowName,
0101 iconName;
0102 char charViewName [100];
0103
0104
0105 private:
0106 G4OpenGLXViewer (const G4OpenGLXViewer&);
0107 G4OpenGLXViewer& operator = (const G4OpenGLXViewer&);
0108 GLXContext tmp_cx;
0109 };
0110
0111 #endif