Re: [GtkGLExt] Sharing display lists among a dynamic set of widgets
- From: Thierry Bernier <thiberlog free fr>
- To: gtkglext-list gnome org
- Subject: Re: [GtkGLExt] Sharing display lists among a dynamic set of widgets
- Date: Sun, 16 Jan 2005 17:39:26 +0100
Timothy M. Shead 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.
I have a similar problem under MinGW (over XP) : when I reparent a
Widget containing a GtkGLExtended widget in its children tree, the
displqy lists are losts after the reparent. Every other GL call works,
but calling the lists draws nothing.
I will post a bug, if you think this is really one.
--
Thiery Bernier
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]