Commit 761d52c1 authored by schultz's avatar schultz

fixed segfault for windows when opengl context is recreated in core

profile
parent 1e7b36af
......@@ -98,20 +98,6 @@
//== IMPLEMENTATION ==========================================================
namespace {
void recreateContext()
{
#ifdef WIN32
QOpenGLContext* ctx = QOpenGLContext::currentContext();
QSurfaceFormat format = QSurfaceFormat::defaultFormat();
ctx->setFormat(format);
ctx->create();
QOffscreenSurface* surface = new QOffscreenSurface();
ctx->makeCurrent(surface);
#endif
}
}
/** \brief Constuctor for the Core Widget ( This is stage 1 , call init for stage 2)
*
* Initialization is working the following way:\n
......@@ -667,7 +653,6 @@ Core::init() {
coreWidget_->splitter_->restoreState (windowStates.value("Core/LogSplitter").toByteArray ());
coreWidget_->show();
recreateContext();
applyOptions();
......@@ -686,7 +671,6 @@ Core::init() {
} else {
coreWidget_->show();
recreateContext();
applyOptions();
......
......@@ -64,7 +64,7 @@
#include "QtBaseViewer.hh"
#include <OpenFlipper/common/GlobalOptions.hh>
#include <QOffscreenSurface>
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,4))
#include <QOpenGLContext>
#endif
......@@ -98,6 +98,17 @@ void glViewer::startGLDebugLogger()
if (OpenFlipper::Options::debug())
{
delete glDebugLogger_;
//workaround for windows, because the DebugContext flag is discarded by QMainWindow show in core.cc
#ifdef WIN32
QOpenGLContext* ctx = QOpenGLContext::currentContext();
QSurfaceFormat format = QSurfaceFormat::defaultFormat();
ctx->setFormat(format);
ctx->create();
QOffscreenSurface* surface = new QOffscreenSurface();
surface->create();
ctx->makeCurrent(surface);
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////
glDebugLogger_ = new QOpenGLDebugLogger(this);
if (glDebugLogger_->initialize())
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment