Re: Fwd: [GtkGLExt] troubles with shareing display lists



Hi!
I very much appreciate the effort you put into this code.  I compiled it and tried running it, and I got the message "List not shared" and a blank window.  I noticed that when you build your global_context, you set the direct rendering parameter in gdk_gl_context_new() to FALSE.  This is interesting, because both the code posted by Tim and my code set it to "TRUE."  Setting it to false makes sense to me, actually... but I'm the one who doesn't know what's going on!!
When I tried setting it to TRUE in your code as an experiment, it just crashed with an X error.  My code, which uses the TRUE setting, does not crash, but I also do not build any display lists until the first window that needs them is created and realized.  I'm not saying that's the proper way to do it, it's just the way I ended up doing it.
Sorry to add to the confusion. 
walter

Roberto Huelga <rhuelga gmail com> wrote:


---------- Forwarded message ----------
From: Roberto Huelga <rhuelga gmail com>
Date: Jan 14, 2006 12:02 PM
Subject: Re: [GtkGLExt] troubles with shareing display lists
To: walter tallent <w41t3r yahoo com>

Hi Walter.

Here I upload a quick test of pixmap offscreen render, it share the opengl context with a widget without problem on my machine. Only note that this way doesn't work on win32.

I don't follow well your classes, so if you want me to test your way, send a working sample so we can try it.

You can use a pbuffer. It will speed your opengl render on the offscreen but it's not implemented on all machines, try the simple-pbuffer-sigx.c sample in gtkgl ext for pbuffer.


On 1/14/06, walter tallent <w41t3r yahoo com> wrote:
Hi.
I'm working on a program in which I want to be able to load one copy of my textures and build one copy of my models and have multiple windows show these things.  I also want no restrictions on how windows might be opened and closed, in other words, I don't want to have a "master window" that holds the shared display lists, and if it is closed, all windows die.  About a year ago some code was posted on this list that was an attempt to accomplish this using an offscre en GdkGLPixmap to "hold" the display lists.  The code was similar to the following (which I am currently attempting to use):

I'm using an OO approach with gtk objects, btw.
In "gl-share" instance_init I have:

        priv->glconfig = gdk_gl_config_new_by_mode(GDK_GL_MODE_RGBA |
                               GDK_GL_MODE_DOUBLE |
                               GDK_GL_MODE_DEPTH |
                           GDK_GL_MODE_STENCIL);

        GdkPixmap *pixmap = gdk_pixmap_new(NULL, 8, 8, gdk_gl_config_get_depth(priv->glconfig));

        GdkGLPixmap *glpixmap = gdk_pixmap_set_gl_capability(pixmap, priv->glconfig, NULL);
   
        GdkGLDrawable * gdgld = gdk_pixmap_get_gl_drawable(pixmap);

    priv->share_list = gdk_gl_context_new(gdgld, NULL, TRUE, GDK_GL_RGBA_TYPE);

then in "gl-client-win" instance_init (maybe bad choice of name):

      gtk_widget_set_gl_capability (GTK_WIDGET(self),
                                   gl_share_get_gl_config(),
                                     gl_share_get_share_list(),
                                       TRUE,
                                     GDK_GL_RGBA_TYPE);

And the first gl-clie nt-win to be instanciated calls gl_share_create_lists() during its realize callback.  This code appears to work.  I can open new windows until my fingers hurt, with textures and models galore, but if I start to close some windows and open new ones, I quickly get to see the following backtrace in gdb:

Program received signal SIGSEGV, Segmentation fault.
0x0837fb3b in ?? ()
(gdb) backtrace
#0  0x0837fb3b in ?? ()
#1  0x0000007b in ?? ()
#2  0x0000007b in ?? ()
#3  0xb6a5f3b2 in __driGarbageCollectDrawables ()
   from /usr/X11R6/lib/modules/dri/r200_dri.so
#4  0xb6a5ff13 in driDestroyContext ()
   from /usr/X11R6/lib/modules/dri/r200_dri.so
#5  0xb77047f7 in DestroyContext () from /usr/X11R6/lib/libGL.so.1
#6  0xb77f1d2f in _gdk_gl_context_destroy (glcontext=0x8077230)
    at gdkglcontext-x11.c:109
#7  0xb77ce489 in gdk_gl_context_destroy (glcontext=0x8ab27b8)
    at gdkglcontext.c:119
#8  0xb7804548 in gtk_gl_widget_unrealize (widget=0x89155a8, private=0x8915208)
    at gtkglwidget.c:149
... etc etc ... 

I've stepped through the code a few times, and at this point I'm not sure if the bug is in my code (most likely) or gtkglext, and worse, I'm not sure how to find out.  I was hoping that someone who has implemented a similar sharing strategy, perha ps even the fellow who posted the GdkGLPixmap code snippet so long ago (wink, wink) might recognize this crash and know the answer... or at least have a working implementation and can advise me. 
Oh yes, in case it hasn't become apparent already, I'm not entirely an expert with X windows/Gtk/OpenGL programming, though I'm slowly getting better.
Any help will be greatly appreciated. 
Oh yes, and I'm glad that gtkglext is experiencing a reawakening!
thanks for listening
walter


Yahoo! Photos
Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.

_______________________________________________
gtkglext-list mailing list
gtkglext-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkglext-list




_______________________________________________
gtkglext-list mailing list
gtkglext-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkglext-list


Yahoo! Photos
Got holiday prints? See all the ways to get quality prints in your hands ASAP.

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