/**
 * Cleans up and destroys context and pbuffer
 */
GLXPBuffer::~GLXPBuffer()
{
	if (m_glxContext && !m_bSharedContext)
		glXDestroyContext(m_pDisplay, m_glxContext);
	if (m_glxPbuffer)
		glXDestroyGLXPbufferSGIX(m_pDisplay, m_glxPbuffer);
}
Exemple #2
0
int
main(int argc, char *argv[])
{
   if (argc!=4) {
      Usage(argv[0]);
   }
   else {
      int width = atoi(argv[1]);
      int height = atoi(argv[2]);
      char *fileName = argv[3];
      if (width<=0) {
         printf("Error: width parameter must be at least 1.\n");
         return 1;
      }
      if (height<=0) {
         printf("Error: height parameter must be at least 1.\n");
         return 1;
      }
      if (!Setup(width, height)) {
         return 1;
      }
      Render();
      WriteFile(fileName);
      glXDestroyGLXPbufferSGIX( gDpy, gPBuffer );
   }
   return 0;
}
RenderImageImplPBuffer::~RenderImageImplPBuffer()
{
    if (myContext)
        glXDestroyContext(myDisplay, myContext);

    if (myPBuffer)
        glXDestroyGLXPbufferSGIX(myDisplay, myPBuffer);

    XCloseDisplay(myDisplay);

    // This is to make sure that another valid context is made
    // active after we destroy the P-Buffer's one
    Context::SetReferenceActive();
}
Exemple #4
0
void
DestroyPbuffer(Display *dpy, int screen, PBUFFER pbuffer)
{
   int pbSupport = QueryPbuffers(dpy, screen);
#if defined(GLX_VERSION_1_3)
   if (pbSupport == 1) {
      glXDestroyPbuffer(dpy, pbuffer);
      return;
   }
#endif
#if defined(GLX_SGIX_fbconfig) && defined(GLX_SGIX_pbuffer)
   if (pbSupport == 2) {
      glXDestroyGLXPbufferSGIX(dpy, pbuffer);
      return;
   }
#endif
}
void VolumeRendererShell::DestroyDisplay() {

#ifdef SAGE

  // Clean up pbuffer
  glXDestroyGLXPbufferSGIX(_xDisplay, _glXPBuffer);

  // Clean up visual info
  XFree(_xVisualInfo);

  // Close X connection
  XCloseDisplay(_xDisplay);

#else
  
  // Quit SDL
  SDL_Quit();

#endif

}