Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
5.9.3
-
None
-
Windows 10, Mac OS X 10.13.3
Description
I create an offscreen surface in the constructor of my widget and store its pointer in a global variable with the following code:
LAUManOWarGLContext::offScreenSurface = new QOffscreenSurface(QGuiApplication::screens().first()); LAUManOWarGLContext::offScreenSurface->create(); if (LAUManOWarGLContext::offScreenSurface->isValid()) {
I then create a thread, inside of which I create a QOpenGLContext with the following code:
// CREATE A GLCONTEXT TO DO THE PROCESSING LAUManOWarGLContext *context = new LAUManOWarGLContext(lookUpTable); context->setFormat(LAUManOWarGLContext::offScreenSurface->format()); context->setSurface(LAUManOWarGLContext::offScreenSurface); context->create(); context->initialize();
but sadly the code crashes on Windows 10 saying that the QOffscreenSurface was not created in the GUI thread.
I've searched all the documentation, and everything says that the QOffscreenSurface must be created in the main GUI thread (and it is), but nothing that says that context must be created in the main thread. So what gives?