Windows Error #2000: Win32WindowingSystem::OpenGLContext() - Unable to restore current OpenGL rendering context. Reason: 无效的像素格式。
执行完
osg::ref_ptr<osg::Node> node = osgDB::readNodeFile("mb_tiles.earth",myReadOptions);
后再执行
QOpenGLFramebufferObjectFormat format;
format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
format.setSamples(4);
auto fbo = new QOpenGLFramebufferObject(size, format);
会报上述错误。
如果改成
osg::ref_ptr<osg::Node> node = osgDB::readNodeFile("cow.osg");
则不会报错。
该错误是在这里产生的
osgViewer/GraphicsWindowWin32.cpp
Win32WindowingSystem::OpenGLContext::~OpenGLContext()
{
if (_restorePreviousOnExit && _previousHglrc!=_hglrc && !::wglMakeCurrent(_previousHdc, _previousHglr