34#ifdef G4VIS_BUILD_OPENGLX_DRIVER
41G4OpenGLStoredXViewer::
42G4OpenGLStoredXViewer (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;
59G4OpenGLStoredXViewer::~G4OpenGLStoredXViewer () {}
61void G4OpenGLStoredXViewer::Initialise () {
64 printf(
"G4OpenGLStoredXViewer::Initialise\n");
66 CreateGLXContext (vi_stored);
72 glDrawBuffer (GL_BACK);
75void G4OpenGLStoredXViewer::DrawView () {
78 printf(
"G4OpenGLStoredXViewer::DrawView\n");
81 glXMakeCurrent (dpy, win, cx);
89 if (!fNeedKernelVisit) KernelVisitDecision ();
90 G4bool kernelVisitWasNeeded = fNeedKernelVisit;
98 printf(
"G4OpenGLStoredXViewer::DrawView flush \n");
102 HaloingSecondPass ();
108 if (!kernelVisitWasNeeded) {
109#ifdef G4DEBUG_VIS_OGL
110 printf(
"G4OpenGLStoredXViewer::DrawView NO need kernel visit\n");
116#ifdef G4DEBUG_VIS_OGL
117 printf(
"G4OpenGLStoredXViewer::DrawView NEED kernel visit\n");
121 if (fVP.IsCutaway() &&
135void G4OpenGLStoredXViewer::FinishView () {
136#ifdef G4DEBUG_VIS_OGL
137 printf(
"G4OpenGLStoredXViewer::FinishView\n");
142#ifdef G4DEBUG_VIS_OGL
143 printf(
"G4OpenGLStoredXViewer::FinishView flush \n");
148 glGetIntegerv(GL_RENDER_MODE, &renderMode);
149 if (renderMode == GL_RENDER) glXSwapBuffers (dpy, win);
G4DLLIMPORT std::ostream G4cerr