[osg-users] OSG in Gtk3 GLArea

Robert Osfield robert.osfield at gmail.com
Mon Jun 4 01:42:25 PDT 2018

Hi MT, (Mean Taipan, is that you're real name? You go by Mean? Sorry
but it's hard to assume that you are older than 6... if you are 6,
awesome, if you're not, ouch perhaps you should start communicating
with a form near to your actual age as your probably aren't conveying
the right tone/image.)

If GTK is dropping non GL core profile support, than wow, that's even
bigger an own goal as large as the one that Apple did to themselves.
One of the biggest value adds of GL is backwards/forwards
compatibility so to just discard this is a stupid decision.

How to get around it, on the OSG side the only thing you'll be able to
do with a GTK created core profile GL context is build it against
GLCORE from the ground up and just uses shaders in your application
like you now have to do under OSX.

The other alternative is to create your own graphics context on a Gtk
widget.  I have no clue how to do this as I'm no Gtk user

Finally you could just ditch Gtk and use an Windowing API that doesn't
shoot itself in the foot.


On 1 June 2018 at 23:11, Mean Taipan <hardy.woodland.cypress at gmail.com> wrote:
> 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)
> messages.
> 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).
> Regards,
> MT
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=73920#73920
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

More information about the osg-users mailing list