[GtkGLExt] GtkGlExt and OSMesa



Hi all,

I am trying to use OSMesa to do offscreen rendering within a GtkGlExt program.

The problem I have is that after I set the current openGL context to OSMesa using sthg like:

OSMesaContext ctx = OSMesaCreateContextExt (OSMESA_RGBA, 16, 0, 0, NULL);
OSMesaMakeCurrent (ctx, image, GL_UNSIGNED_BYTE, width, height);
render_image();
save_image();
OSMesaDestroyContext (ctx);

and try to rerender the image in a GtkGlExt window, nothing is rendered.

I suppose it is not very surprising as I expect I have to restore the GtkGlExt context in some way. How would you do this?

I have tried calling gdk_gl_drawable_make_current() after OSMesaDestroyContext (ctx), using the saved GdkGlContext and GdkGlDrawable but this does not seem to work.

Any help would be much appreciated. A complete example on how to use OSMesa within GtkGlExt would be ideal but any other suggestion or option for offscreen rendering would be welcome.

cheers,

Stephane




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