Hi,
after thinking about this a bit, I think I know exactly what's the problem -- there's one really filthy corner of the whole OpenGL state machine, where it's possible to accidentally modify a VAO if one (un)binds an index buffer while a VAO is bound. And that's I think exactly what Qt is doing: unbinding an index buffer, which then causes a crash because it's trying to load index data from memory at pointer zero. Boom.
Anyway, that's me just thinking out loud. Can you try the following? Once you confirm that this is indeed the case, I'll make it part of Magnum API:
- Right before QQuickWindow::resetOpenGLState(), so at the end of your magnum code block, call glBindVertexArray(0);
Thanks
mosra
> Datum: 13.02.2018 01:16
> Předmět: Re: [magnum] Rendering into a Qt QOpenGLFramebufferObject
>
>Hi mosra,
>
>That's great thanks for the help. Renderer::setClearColor works perfectly!
>
>However, if you don't mind, I've ran into another issue :(
>
>I'm trying to 'upgrade' my application to the Primitives Example. Now the
>first frame renders correctly, but second frame causes a segfault caused by
>a call to glDrawRangeElements in Mesh::drawInternal()
>(
https://github.com/mosra/magnum/blob/master/src/Magnum/Mesh.cpp#L315) --
>now running a debug build of Magnum from the latest on master.
>
>My hunch is that Qt playing around with OpenGL state is to blame again..
>Context::resetState() is still being used before any render calls.
>
>Any ideas with this one? Thanks again in advance for your help!
>
>Cheers
>James
>
>On Saturday, 10 February 2018 22:29:16 UTC, mosra wrote:
>>