Re: [GtkGLExt] Sharing display lists among a dynamic set of widgets



Dave Andruczyk wrote:
--- "Timothy M. Shead" <tshead k-3d com> wrote:


My application (http://k3d.sourceforge.net) provides users with zero-to-many OpenGL views of a 3D scene, with users able to create and destroy views at-will. We also need to share display lists between views for efficiency. The problem is that if the "first" view (the one which is passed to subsequent views as the "share_list" argument) is destroyed, all the display lists go with it. I'm wondering if there is any way around this, besides creating a hidden widget with a GdkGLContext that never gets destroyed? Could the reference count of the "first" GdkGLContext be managed to prevent its destruction?



You answered it at the end.  Just increment it's reference count for each
additional view (decrement the refcount when the view is destroyed )and it
won't get destroyed until the refcount is zero.

Unfortunately the reference counting just isn't working for me - after digging into the source, I see that the share list is already being ref-counted to prevent its destruction, but the display lists still stop working when I close the first view. It seems as if forcing the GdkGLContext to stick around isn't enough, my guess is that when the drawable/X window is lost, something happens to the underlying glx context. Looks like I will have to try the hidden widget trick.

Many Thanks!
Tim



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