[osg-users] OSG in Gtk3 GLArea

Mean Taipan hardy.woodland.cypress at gmail.com
Fri Jun 1 15:11:56 PDT 2018

Hi all,

First, a bit of background, then some questions:

My company has a machine controller application that I wrote that uses OSG for rendering machine status into a Gtk widget using the (old) gtkglext library.  This worked up to about Gtk 3.10 (Ubuntu 14.04), but since we are being forced to upgrade to Gtk 3.18 (Ubuntu 16.04) our old hack doesn't work.  

gtkglext is no longer supported, and in their wisdom the gtk developers are dragging us all kicking and screaming into the OpenGL 3.2 world, forcing us to use "core profile" (whatever that is).  We now have to use GLArea widget, which is basically no problem, except that running OSG from the 'render' callback does nothing except draw the background color and then issue a bunch of 

  detected OpenGL error 'invalid operation' (blah blah)


So the questions are:

1 - is there any way to coax OSG to emit only this new-fangled core profile calls when we call Viewer::frame() from within the Gtk GLArea widget render callback?

2 - failing that, is it possible to fool GLArea by (for example) getting OSG to render into a buffer, using good old glBegin/End that's now a no-no, then somehow getting that buffer to the GLArea context using the sanctioned commands?

3 - has anyone out there got OSG rendering to Gtk GLArea, and willing to share code?  (I can't believe nobody is doing this, but the google is surprisingly unhelpful).


Read this topic online here:

More information about the osg-users mailing list