Re: [GtkGLExt] Problem with shared lists



Hi,

I am very glad to inform that I solved the problem with shared lists, this was NOT a bug in GtlGLExt, it was just bad design on my app.

Everytime I created a new GL area, I provided always the same GLContext, created for the first GL area (as in the shared_lists.c example). I thought this GLContext would be shared between all GL areas. This works fine when GL areas are not removed:

gtk_widget_set_gl_capability (area,
glconfig, first_glcontext_created, TRUE, GDK_GL_RGBA_TYPE);

However, when the first window is removed, the first GLContext is no longer valid, and new GL areas are unable to get the shared info from it. The solution is to provide always the GLContext of a GL area that exists now, tipically the first one (not necessarily the first one initially). In that case, the shared lists info is correctly replicated. As long as there is always at least one GL area active, from where to get the GLContext, this method works fine.

glcontext = gtk_widget_get_gl_context (valid_gl_area_now);

gtk_widget_set_gl_capability (area,
glconfig, glcontext, TRUE, GDK_GL_RGBA_TYPE);

In my case I had basically to replace one line by another.

Braden, thanks again for replying,
Carlos
On Mon, 2010-02-22 at 15:15 +0000, Carlos Pereira wrote:
Definitely it seems that when a GLContext (for a given drawing area) is removed, shared pre-compiled OpenGL lists already made are no longer available for new GLContexts (new drawing areas), though they still work in old GLContexts. This problem did not exist with GTKGLArea, I just confirmed with some old code. Clearly this is a GtkGLExt-specific issue, either I am not using GtkGLExt correctly or there is a bug in GtkGLExt.

This problem should affect any app supporting multiple, independent, top windows, each one with a GL area (windows can be created and removed, as long as at least one window exists at any given moment, not necessarily the first window, created when the app started).

Can someone help me on this? shall I copy the GLContext of a top window (where the shared lists information is kept) before it is removed? to where?

Please file a bug on this at bugzilla.gnome.org.  It would help a lot
with tracking this down if you could provide a reduced test case that
demonstrates the problem.




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