33 #ifdef G4VIS_BUILD_OPENGLX_DRIVER
41 G4OpenGLStoredXViewer::
42 G4OpenGLStoredXViewer (G4OpenGLStoredSceneHandler& sceneHandler,
44 :
G4VViewer (sceneHandler, sceneHandler.IncrementViewCount (), name),
45 G4OpenGLViewer (sceneHandler),
46 G4OpenGLXViewer (sceneHandler),
47 G4OpenGLStoredViewer (sceneHandler)
49 if (fViewId < 0)
return;
53 G4cerr <<
"G4OpenGLStoredXViewer::G4OpenGLStoredXViewer -"
54 " G4OpenGLXViewer couldn't get a visual." <<
G4endl;
59 G4OpenGLStoredXViewer::~G4OpenGLStoredXViewer () {}
61 void G4OpenGLStoredXViewer::Initialise () {
63 #ifdef G4DEBUG_VIS_OGL
64 printf(
"G4OpenGLStoredXViewer::Initialise\n");
66 CreateGLXContext (vi_stored);
72 glDrawBuffer (GL_BACK);
75 void G4OpenGLStoredXViewer::DrawView () {
77 #ifdef G4DEBUG_VIS_OGL
78 printf(
"G4OpenGLStoredXViewer::DrawView\n");
87 if (!fNeedKernelVisit) KernelVisitDecision ();
88 G4bool kernelVisitWasNeeded = fNeedKernelVisit;
95 #ifdef G4DEBUG_VIS_OGL
96 printf(
"G4OpenGLStoredXViewer::DrawView flush \n");
100 HaloingSecondPass ();
106 if (!kernelVisitWasNeeded) {
107 #ifdef G4DEBUG_VIS_OGL
108 printf(
"G4OpenGLStoredXViewer::DrawView NO need kernel visit\n");
114 #ifdef G4DEBUG_VIS_OGL
115 printf(
"G4OpenGLStoredXViewer::DrawView NEED kernel visit\n");
119 if (fVP.IsCutaway() &&
133 void G4OpenGLStoredXViewer::FinishView () {
134 #ifdef G4DEBUG_VIS_OGL
135 printf(
"G4OpenGLStoredXViewer::FinishView\n");
140 #ifdef G4DEBUG_VIS_OGL
141 printf(
"G4OpenGLStoredXViewer::FinishView flush \n");
146 glGetIntegerv(GL_RENDER_MODE, &renderMode);
147 if (renderMode == GL_RENDER) glXSwapBuffers (dpy, win);