Embedded Qt via raw OpenGL in a RenderQueueListener broken

Problems building or running the engine, queries about how to use features etc.
Post Reply
Ralith
Gnoblar
Posts: 11
Joined: Sun Mar 18, 2007 7:06 am

Embedded Qt via raw OpenGL in a RenderQueueListener broken

Post 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:
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Embedded Qt via raw OpenGL in a RenderQueueListener broken

Post 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:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ralith
Gnoblar
Posts: 11
Joined: Sun Mar 18, 2007 7:06 am

Re: Embedded Qt via raw OpenGL in a RenderQueueListener broken

Post by Ralith »

Because I'm trying to embed Qt in Ogre, not Ogre in Qt.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Embedded Qt via raw OpenGL in a RenderQueueListener broken

Post 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..
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ralith
Gnoblar
Posts: 11
Joined: Sun Mar 18, 2007 7:06 am

Re: Embedded Qt via raw OpenGL in a RenderQueueListener broken

Post 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?
Post Reply