[osg-users] osgviewerQt integration required

379 views
Skip to first unread message

manish Choudhary

unread,
Jun 10, 2015, 7:32:08 AM6/10/15
to osg-...@lists.openscenegraph.org
Hi,
I need to use OSG scene as view Widget in QT.
I my application I have multi view and want one view to be OSG scene view.

I have gone thru example_osgviewerQt but it is abort by saying
Warning: detected OpenGL error 'invalid operation' at Before Renderer::compile
Error: In Texture::Extensions::setupGLExtensions(..) OpenGL version test failed, requires valid graphics context.


How to remove this error and how to integrate osg view to QT ?


Thank you!

Cheers,
manish

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64031#64031





_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

manish Choudhary

unread,
Jun 11, 2015, 7:41:42 AM6/11/15
to osg-...@lists.openscenegraph.org
Hi,

Have not found the solution regarding above issue?
Please Help.
...

Thank you!

Cheers,
manish

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64052#64052

Robert Osfield

unread,
Jun 11, 2015, 8:59:50 AM6/11/15
to OpenSceneGraph Users
Hi Manish,

I'm not a Qt user so can't help with the specifics. Others with more
Qt experience might well be a bit clueless to what's wrong at your end
as you don't provide any code or many details. You won't get many
answers if no one has enough information to know what might be wrong.

For starts, does osgviewerQt work without any modifications?

Which version of Qt are you using? What platform?

Which version of the OSG?

Robert.

manish Choudhary

unread,
Jun 11, 2015, 10:44:02 AM6/11/15
to osg-...@lists.openscenegraph.org
Hi,

I'm using Qt 5.4.2 for Windows 32-bit (VS 2013) and OpenSceneGraph-3.2.2 stable release on Window 8.1 platform.
osgviewerQt example is not working without any modification.
It is aborts and in the command prompt it showing
"Warning: detected OpenGL error 'invalid operation' at Before Renderer::compile
Error: In Texture::Extensions::setupGLExtensions(..) OpenGL version test failed, requires valid graphics context. "

Earlier in my application I have used osg 2.8 in Qt(4.8 VS 2008 - Window 8 ) using "class ViewerQT : public osgViewer::Viewer, public AdapterWidget" to integrate osg in QT. (attached file showing this integration)

Now I want to switch to latest QT (5.4) and Osg (3.2) and but in this latest version ealier(old) osg Qt intergration didn't work. So I look for osgviewerQt example . But both showing same type of error.

Why osgviewerQt example not working that seem strange to me.?




...

Thank you!

Cheers,
manish

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64056#64056



header.h

Robert Osfield

unread,
Jun 11, 2015, 11:30:55 AM6/11/15
to OpenSceneGraph Users
HI Manish,

I could be a Qt change in behavior that it's setting the context up or
managing the threads in an different way. Qt's this moving goal posts
with trying to integrate. Each rev it the way Qt works w.r.t OpenGL
shifts a bit.

One thing you could try is OSG-svn/trunk or the OSG-3.3.7 dev release.
There is chance that revisions to osgQt help keep track of the later
versions of Qt better.

However, I'm not personally a Qt expert. I have to defer to others to
provide expertise.

Robert.

Jan Ciger

unread,
Jun 11, 2015, 11:37:04 AM6/11/15
to OpenSceneGraph Users
On Thu, Jun 11, 2015 at 4:43 PM, manish Choudhary <osgf...@tevs.eu> wrote:
> Hi,
>
> I'm using Qt 5.4.2 for Windows 32-bit (VS 2013) and OpenSceneGraph-3.2.2 stable release on Window 8.1 platform.
> osgviewerQt example is not working without any modification.
> It is aborts and in the command prompt it showing
> "Warning: detected OpenGL error 'invalid operation' at Before Renderer::compile
> Error: In Texture::Extensions::setupGLExtensions(..) OpenGL version test failed, requires valid graphics context. "
>
...
>
> Why osgviewerQt example not working that seem strange to me.?

Those errors are Qt/OpenGL problems, not OSG issues.

Did you install the Qt version using the Angle emulation, by chance? I
believe that is the default download. Angle supports only OpenGL ES
2.x and translates that to Direct3D calls, so any code requiring
"true" OpenGL will not work with that. The Angle backend is mainly
there to accelerate the Qt scenegraph and is not really a full OpenGL
implementation. Make sure to download the version of Qt with the
native OpenGL support

The versions with "OpenGL" in the name are the correct ones:
http://www.qt.io/download-open-source/#section-2

If that is OK, then make sure you have the vendor OpenGL drivers for
your graphic card installed (from AMD or Nvidia) - Windows used to
ship with an ancient version of OpenGL, that will not work with OSG.

Regards,

J.

Alistair Baxter

unread,
Jun 12, 2015, 7:36:57 AM6/12/15
to OpenSceneGraph Users
Actually the default version Qt 5.4 dynamically selects what it thinks is the most appropriate version of OpenGL to use.

You can force it to use desktop OpenGL by calling QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL) on your app instance before you call exec on it.

Jan Ciger

unread,
Jun 12, 2015, 7:42:41 AM6/12/15
to OpenSceneGraph Users
On Fri, Jun 12, 2015 at 1:36 PM, Alistair Baxter <alis...@mve.com> wrote:
> Actually the default version Qt 5.4 dynamically selects what it thinks is the most appropriate version of OpenGL to use.
>
> You can force it to use desktop OpenGL by calling QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL) on your app instance before you call exec on it.

Ah interesting to know. That wasn't the case before.

Thanks for the tip.

J.

manish Choudhary

unread,
Jun 13, 2015, 3:06:56 AM6/13/15
to osg-...@lists.openscenegraph.org
Hi,

Problem resolved once I downloaded version of Qt with the
native OpenGL support.
Now osgviewerQt example is working fine.

"Probelm was occured because i install the Qt version using the Angle emulation, by chance. Angle supports only OpenGL ES
2.x and translates that to Direct3D calls, so any code requiring
"true" OpenGL will not work with that." As mentioned by Jan Ciger




Thanks you all for your support
...

Thank you!

Cheers,
manish

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64085#64085

Jan Ciger

unread,
Jun 13, 2015, 7:29:08 AM6/13/15
to osg-...@lists.openscenegraph.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/13/2015 09:06 AM, manish Choudhary wrote:
> Hi,
>
> Problem resolved once I downloaded version of Qt with the native
> OpenGL support. Now osgviewerQt example is working fine.
>
...
> Thanks you all for your support

You are welcome!

All the best,

Jan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iD8DBQFVfBP5n11XseNj94gRAs/sAKDvalHIrO7gxJHO1O9iJa8KBHZQyACghLCj
cToDf5buGZCg0Z4ldUPdNT0=
=ABHF
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages