simplify to define when to use which offscreen rendering method
This commit is contained in:
@@ -411,11 +411,7 @@ void SoQtOffscreenRenderer::init(const SbViewportRegion & vpr,
|
||||
this->framebuffer = NULL;
|
||||
this->numSamples = -1;
|
||||
this->cache_context = 0;
|
||||
#if !defined(HAVE_QT5_OPENGL)
|
||||
this->pbuffer = QGLPixelBuffer::hasOpenGLPbuffers();
|
||||
#else
|
||||
this->pbuffer = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -927,14 +927,7 @@ void View3DInventorViewer::setSceneGraph(SoNode* root)
|
||||
|
||||
void View3DInventorViewer::savePicture(int w, int h, const QColor& bg, QImage& img) const
|
||||
{
|
||||
// If 'QGLPixelBuffer::hasOpenGLPbuffers()' returns false then
|
||||
// SoQtOffscreenRenderer won't work. In this case we try to use
|
||||
// Coin's implementation of the off-screen rendering.
|
||||
#if !defined(HAVE_QT5_OPENGL)
|
||||
bool useCoinOffscreenRenderer = !QGLPixelBuffer::hasOpenGLPbuffers();
|
||||
#else
|
||||
bool useCoinOffscreenRenderer = false;
|
||||
#endif
|
||||
useCoinOffscreenRenderer = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Document")->
|
||||
GetBool("CoinOffscreenRenderer", useCoinOffscreenRenderer);
|
||||
|
||||
@@ -755,13 +755,8 @@ Py::Object View3DInventorPy::saveImage(const Py::Tuple& args)
|
||||
bg.setNamedColor(colname);
|
||||
|
||||
QImage img;
|
||||
#if !defined(HAVE_QT5_OPENGL)
|
||||
bool pbuffer = QGLPixelBuffer::hasOpenGLPbuffers();
|
||||
#else
|
||||
bool pbuffer = false;
|
||||
#endif
|
||||
if (App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Document")->GetBool("DisablePBuffers",!pbuffer)) {
|
||||
("User parameter:BaseApp/Preferences/Document")->GetBool("DisablePBuffers", false)) {
|
||||
createImageFromFramebuffer(w, h, bg, img);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user