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 » Sun Jul 12, 2009 10:52 pm

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:
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: Embedded Qt via raw OpenGL in a RenderQueueListener broken

Post by jacmoe » Sun Jul 12, 2009 11:37 pm

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:
0 x
/* 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 » Mon Jul 13, 2009 7:16 am

Because I'm trying to embed Qt in Ogre, not Ogre in Qt.
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: Embedded Qt via raw OpenGL in a RenderQueueListener broken

Post by jacmoe » Mon Jul 13, 2009 7:26 am

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..
0 x
/* 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 » Tue Jul 14, 2009 2:55 am

Look at my question from this perspective: Why are the raw OpenGL commands that are being issued not resulting in stuff being drawn?
0 x

Post Reply