[osg-users] Qt OpenGL Warning opengl
Robert Osfield
robert.osfield at gmail.com
Wed Apr 27 00:37:25 PDT 2016
HI Auke-Dirke,
On 25 April 2016 at 14:07, Auke-Dirk Pietersma <aukedirk at horus.nu> wrote:
> I have the following issue. Whenever i choose to render a scene with
> opengl greater than 2.1 i get the following messages.
>
> Warning: detected OpenGL error 'invalid enumerant' after applying GLMode
> 0xb50
> Warning: detected OpenGL error 'invalid enumerant' after applying GLMode
> 0x4000
> Warning: detected OpenGL error 'invalid operation' after applying
> attribute LightModel
>
> Not only do i obtain these messages, the scene also does not get rendered.
>
> Nothing fancy has been done, see this init snippet:
>
> graphicsWindow_ = new osgViewer::GraphicsWindowEmbedded( this->x(),
> this->y(),this->width(),this->height() );
> viewer_ = new osgViewer::Viewer;
>
> osg::Camera* camera = new osg::Camera;
> camera->setViewport( 0, 0, this->width(), this->height() );
> float aspectRatio = static_cast<float>( this->width()) /
> static_cast<float>( this->height() );
> camera->setClearColor( osg::Vec4( 0.f, 0.f, 1.f, 1.f ) );
> camera->setProjectionMatrixAsPerspective( 30.f, aspectRatio, 1.f,
> 1000.f );
> camera->setGraphicsContext( graphicsWindow_ );
> viewer_->setCamera(camera);
>
> _earthManip = new osgEarth::Util::EarthManipulator;
>
> viewer_->setCameraManipulator(_earthManip, false);
> viewer_->addEventHandler(new osgViewer::StatsHandler);
>
>
> osg::ref_ptr<osg::Group> group = new osg::Group();
> _mapNode = createMapNode();
> group->addChild(_mapNode);
> _earthManip->setNode( _mapNode->getTerrainEngine() );
>
> viewer_->setSceneData(group.release());
>
> I'm Working on Linux with Qt5.6 on an ATI HAWAII , Radeon R9 Series.
>
> Can someone provide me with some hints/tips?
>
I presume you are using Qt to create the graphics context. Is that you are
creating a context with a core profile with the compatibility profile
disabled? The later is required for using the old fixed function pipeline
attributes and modes.
The OSG is able to use all GL3+GL4 features by testing for them at run-time
even if you just create a GL2.x graphics context so there little need for
explictly asking for GL3 core profile context.
Robert.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160427/925253f5/attachment-0003.htm>
More information about the osg-users
mailing list