Re: [GtkGLExt] Problem with shared lists



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?

Thank you very much!
Carlos Pereira
Hi all!

My app supports an arbitrary number of GTK top windows, each one with a GTKGLExt drawing area. I am using OpenGL shared pre-compiled listsI am following the basic design exemplified in the shared_lists.c example that comes with GTKGlExt.

My problem can be described as folows:

1) Launch the app, to create window 1. Create OpenGL shared list A.

2) create window 2 and shared list B. Everything works fine. Lists A and B are shared betwen windows 1 and 2 (if I create more windows and more lists, everything works fine. All lists are shared and work fine).

3) now remove window 1: lists A and B still work fine in  window 2.

4) create window 3. Lists A and B no longer work on window 3.

Clearly, it seems the GLContext (containing the shared lists info) gets corrupted after window 1 is removed. It seems lists are removed when the first GL area is removed...

When I create the first window, I pass this:
gtk_widget_set_gl_capability (area,
glconfig, NULL, TRUE, GDK_GL_RGBA_TYPE);

then after the window is realized, save the glcontext with:
glcontext = gtk_widget_get_gl_context (area);

and when creating all the other windows, pass the saved context:
gtk_widget_set_gl_capability (drawing_area,
glconfig, glcontext, TRUE, GDK_GL_RGBA_TYPE);

Could someone help me please? is this bad design from my part? is it a GtkGlExt bug? is it a Mesa bug?

Thank you very much!
Carlos Pereira







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