[osg-users] Use OSG with an existing renderer in OpenGL ES

Riccardo Corsi riccardo.corsi at kairos3d.it
Mon Nov 21 06:27:14 PST 2016


Hi Fabien,

in your situation the approach suggested by Chris is certainly the most
promising.
Create a second GL context (shared), render everything you need to with osg
in the second context to an FBO target and have Qt retrieve the fbo's
texture content, to display it in one of its widgets/primitives.
This way you don't need to know which GL states Qt/qml uses and/or modifies
and you're sure neither qml nor osg rendering will be corrupted.

You can find a sample integration I wrote some times ago here:
https://github.com/rickyviking/qmlosg
and a more recent example here: https://github.com/podsvirov/osgqtquick

Ricky


On Mon, Nov 21, 2016 at 11:52 AM, Robert Osfield <robert.osfield at gmail.com>
wrote:

> On 21 November 2016 at 09:12, Fabien Boco <fabien.boco at gmail.com> wrote:
> > This is why I'm looking for an OpenGL ES alternative for
> glPush/PopAttrib which works fine on the Windows version application.
>
>
> The alternative to using glPush/glPop on the OSG would be to dirty the
> associated modes and attributes that are tracked in osg::State.  In
> osg::State there are series of haveApplied*() methods to help with
> tell the OSG's state tracking mechanism something has externally
> changed.  This requires you to know what modes and attributes will
> have been changed by the 3rd party code so it's not an easy
> alternative to glPush/glPop.
>
> Personally I find Qt's approach of changing GL state problematic, I
> much prefer windowing libraries to just create a graphics context and
> leave GL work entirely to dedicated graphics libraries.
>
> Robert.
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20161121/c3353d10/attachment-0003.htm>


More information about the osg-users mailing list