33 #ifdef G4VIS_BUILD_OPENGLXM_DRIVER
41 G4OpenGLStoredXmViewer::
42 G4OpenGLStoredXmViewer (G4OpenGLStoredSceneHandler& sceneHandler,
44 :
G4VViewer (sceneHandler, sceneHandler.IncrementViewCount (), name),
45 G4OpenGLViewer (sceneHandler),
46 G4OpenGLXmViewer (sceneHandler),
47 G4OpenGLStoredViewer (sceneHandler)
50 if (fViewId < 0)
return;
54 G4cerr <<
"G4OpenGLStoredXmViewer::G4OpenGLStoredXmViewer -"
55 " G4OpenGLXmViewer couldn't get a visual." <<
G4endl;
60 G4OpenGLStoredXmViewer::~G4OpenGLStoredXmViewer () {
61 GetSceneHandler()->RemoveViewerFromList(
this);
64 void G4OpenGLStoredXmViewer::Initialise () {
66 CreateGLXContext (vi_stored);
72 glDrawBuffer (GL_BACK);
75 void G4OpenGLStoredXmViewer::DrawView () {
76 #ifdef G4DEBUG_VIS_OGL
77 printf(
"G4OpenGLStoredXmViewer::DrawView \n");
85 if (!fNeedKernelVisit) KernelVisitDecision ();
86 G4bool kernelVisitWasNeeded = fNeedKernelVisit;
94 #ifdef G4DEBUG_VIS_OGL
95 printf(
"G4OpenGLStoredXmViewer::DrawView () flush\n");
106 #ifdef G4DEBUG_VIS_OGL
107 printf(
"G4OpenGLStoredXmViewer::DrawView not hlr \n");
111 if (!kernelVisitWasNeeded) {
112 #ifdef G4DEBUG_VIS_OGL
113 printf(
"G4OpenGLStoredXmViewer::ComputeView Don't need kernel Visit \n");
118 #ifdef G4DEBUG_VIS_OGL
119 printf(
"G4OpenGLStoredXmViewer::ComputeView Need kernel Visit \n");
123 if (fVP.IsCutaway() &&
134 #ifdef G4DEBUG_VIS_OGL
135 printf(
"G4OpenGLStoredXmViewer::DrawView ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n");
139 void G4OpenGLStoredXmViewer::FinishView () {
143 #ifdef G4DEBUG_VIS_OGL
144 printf(
"G4OpenGLStoredXmViewer::FinishView () flush \n");
149 glGetIntegerv(GL_RENDER_MODE, &renderMode);
150 if (renderMode == GL_RENDER) glXSwapBuffers (dpy, win);