libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcvd-members] libcvd/cvd_src glwindow.cc


From: Ethan Eade
Subject: [libcvd-members] libcvd/cvd_src glwindow.cc
Date: Wed, 21 Mar 2007 23:49:40 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Ethan Eade <ethaneade>  07/03/21 23:49:40

Modified files:
        cvd_src        : glwindow.cc 

Log message:
        Fixed the destructor so that no glX context is current upon destroying 
the
        window's glX context.  If a context is current and DestroyContext is 
called,
        there is a race condition in X.  This seems to have solved the problem.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/glwindow.cc?cvsroot=libcvd&r1=1.2&r2=1.3

Patches:
Index: glwindow.cc
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd_src/glwindow.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- glwindow.cc 20 Mar 2007 14:16:04 -0000      1.2
+++ glwindow.cc 21 Mar 2007 23:49:40 -0000      1.3
@@ -25,7 +25,6 @@
     Atom delete_atom;
     Cursor null_cursor;
     GLXContext context;
-    int font;  
 };
     
 void CVD::GLWindow::init(const ImageRef& size, int bpp, const std::string& 
title)
@@ -99,11 +98,9 @@
     glOrtho(0, size.x, size.y, 0, -1 , 1);
     glPixelZoom(1,-1);
 
-    int font = glGenLists(256);
     XColor black = {0, 0, 0, 0, 0, 0};
     XFontStruct* fixed = XLoadQueryFont(display, 
"-misc-fixed-medium-r-*-*-12-*-*-*-*-*-*-1" );
     Cursor null_cursor = XCreateGlyphCursor(display, fixed->fid, fixed->fid, ' 
', ' ', &black, &black);
-    glXUseXFont(fixed->fid, 0, 256, font);
     XFreeFont(display, fixed);
 
     state = new State();
@@ -114,17 +111,16 @@
     state->delete_atom = delete_atom;
     state->null_cursor = null_cursor;
     state->context = context;
-    state->font = font;
 }
 
 CVD::GLWindow::~GLWindow()
 {
-    activate();
-    glDeleteLists(state->font,256);
+    glXMakeCurrent(state->display, None, 0);
     glXDestroyContext(state->display, state->context);
+    
+    XUnmapWindow(state->display, state->window);
     XDestroyWindow(state->display, state->window);
     XCloseDisplay(state->display);
-
     delete state;
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]