From fadf2dbc3b9b7e45f4830c3d9c45d7817e223a0d Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 14 Mar 2016 10:35:13 +0100 Subject: [PATCH] + when using QGLFramebufferObject check if a GL context is active --- src/Gui/View3DPy.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Gui/View3DPy.cpp b/src/Gui/View3DPy.cpp index 128c21800..9f83361ef 100644 --- a/src/Gui/View3DPy.cpp +++ b/src/Gui/View3DPy.cpp @@ -30,6 +30,7 @@ # include # include # include +# include # include # include # include @@ -668,6 +669,11 @@ Py::Object View3DInventorPy::isAnimationEnabled(const Py::Tuple& args) void View3DInventorPy::createImageFromFramebuffer(int width, int height, const QColor& bgcolor, QImage& img) { + const QGLContext* context = QGLContext::currentContext(); + if (!context) { + Base::Console().Warning("createImageFromFramebuffer failed because no context is active\n"); + return; + } #if QT_VERSION >= 0x040600 QGLFramebufferObjectFormat format; format.setSamples(8);