Page 1 of 1

Embedded Qt via raw OpenGL in a RenderQueueListener broken

Posted: Sun Jul 12, 2009 10:52 pm
by Ralith
I'm trying to implement Qt-in-Ogre based on Assaf's native OpenGL render code. I've configured Qt and Ogre to share an OpenGL context (Qt can be configured to render into OpenGL with surprising ease), and I manually step Qt at the point at which the example code calls NativeRender. Qt's rendering, which appears as expected when Ogre is not sharing the GL context, is absent, and stranger still, Ogre's rendering is hidden by solid white—probably the result of the clearPass, but that isn't supposed to be drawn over the whole scene as far as I can tell. The only serious diversion I've made from the example is to omit the code

Code: Select all

if (queueGroupId != RENDER_QUEUE_MAIN)
    return;
as I cannot determine its function, and RENDER_QUEUE_MAIN appears to be undefined. Qt's actions on the GL context may include a buffer swap, and as such I call update(false) on my render window instead of using a more traditional Ogre mainloop to disable Ogre's own buffer swapping; as Qt acts at the end of the render queue, I don't expect this to cause problems, but it may be relevant. If I allow Ogre to perform its own buffer swap, on top of that presumably performed by Qt, Ogre appears to render normally (i.e. no white filling the display) but still with no Qt rendering visible. Anybody know what I might be doing wrong?

For reference, my code is visible here:

Re: Embedded Qt via raw OpenGL in a RenderQueueListener broken

Posted: Sun Jul 12, 2009 11:37 pm
by jacmoe
Why not just do this the easy way? :)

You initialize Ogre in initializeGL, render it in paintGL, etc.
You derive from QOpenGLWidget and just override those functions.
Works a treat. :wink:

Re: Embedded Qt via raw OpenGL in a RenderQueueListener broken

Posted: Mon Jul 13, 2009 7:16 am
by Ralith
Because I'm trying to embed Qt in Ogre, not Ogre in Qt.

Re: Embedded Qt via raw OpenGL in a RenderQueueListener broken

Posted: Mon Jul 13, 2009 7:26 am
by jacmoe
Ah yes, sorry. I realise that we've had this conversation in a previous topic. My bad.
I really don't think there's an easy way..

Re: Embedded Qt via raw OpenGL in a RenderQueueListener broken

Posted: Tue Jul 14, 2009 2:55 am
by Ralith
Look at my question from this perspective: Why are the raw OpenGL commands that are being issued not resulting in stuff being drawn?