QtOgre Application Framework - Now using Qt 4.5

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Post Reply
User avatar
Moohasha
Gnoll
Posts: 672
Joined: Fri Dec 07, 2007 7:37 pm
x 8

Re: QtOgre Application Framework - Now using Qt 4.5

Post by Moohasha »

Awesome! Thanks.
Black holes are where God divided by 0
User avatar
benn
Gnoblar
Posts: 19
Joined: Mon Apr 18, 2005 12:38 pm

Re: QtOgre Application Framework - Now using Qt 4.5

Post by benn »

I've been using qtogre and it's fucking cool. I'm loving qt so far. Very very cool toolset. And qtscript is a nice game scripting language.
https://www.cryptovoxels.com/ - Virtual World built on Ethereum
User avatar
Moohasha
Gnoll
Posts: 672
Joined: Fri Dec 07, 2007 7:37 pm
x 8

Re: QtOgre Application Framework - Now using Qt 4.5

Post by Moohasha »

Dude, please watch the language on the forums.
Black holes are where God divided by 0
hagenkaiser
Kobold
Posts: 33
Joined: Tue May 01, 2007 11:21 am

Re: QtOgre Application Framework - Now using Qt 4.5

Post by hagenkaiser »

Hello everyone,

Wanted to start a discussion about how to implement this properly on OSX.
What works(is possible) and what not.
In the earlier posts I saw compiling problems on OSX. So I guess someone is using this on OSX right now?

Because the ogrewidget code doesnt work for me.
the result I get is:
there is an empty qwidget created and then a separate ogrewindow.

besides i could ot find an ifdef in the ogrwidget for osx window creation.
i remember in eralier trials that it had to be done differently on osx:
you had to create the window with ogre and the there is this function qwidgte::create which is able to overtake an already created window.
i tested this approach on my machine and it solved the problem above but...

a widget created like this could not be ebedded in another qwidget.(or at least i could not do it)
and vice versa. (but i think this not possible on other platforms too)

and i cant get the overriding of the painEvent function to work.
(which would be very cool: I think about using qpainter for annotating 3d scenes. do flash-like guis a.s.o)

So anynoe has ideas how to really connect those two awasome SDKs properly?

Cheers
Hagen
User avatar
Moohasha
Gnoll
Posts: 672
Joined: Fri Dec 07, 2007 7:37 pm
x 8

Re: QtOgre Application Framework - Now using Qt 4.5

Post by Moohasha »

I'm not familiar with OSX, and I'm still getting QtOgre setup (well, I'm still getting Qt setup), but that sounds like a similar problem I had when running Ogre inside a QWidget without QtOgre. I was using the window handle to specify an externally created window (the QWidget)0 to use when creating the Ogre::Root object, and if the handle didn't exist yet it automatically created its own window instead. I was setting up Ogre in the QWidget's paintEvent and I can't for the life of me figure out why the handle wouldn't exist if paintEvent is called, but I ended up having to check the handle before setting up Ogre to make sure it existed, and then everything worked fine.
So perhaps something similar is happening for you?
Black holes are where God divided by 0
trnrez
Greenskin
Posts: 127
Joined: Mon Jan 19, 2009 5:34 pm
Location: Murfreesboro, TN
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by trnrez »

hagenkaiser wrote: So anynoe has ideas how to really connect those two awasome SDKs properly?
I'm not familiar with mac + qt but I have seen this discussed in the forums and the wiki. Here are the two links I have bookmarked (Mac + Qt is on my todo list :D):

http://www.ogre3d.org/forums/viewtopic.php?p=258064
http://www.ogre3d.org/wiki/index.php/QtOgre

Hope that helps you out a bit.
Image Image
hagenkaiser
Kobold
Posts: 33
Joined: Tue May 01, 2007 11:21 am

Re: QtOgre Application Framework - Now using Qt 4.5

Post by hagenkaiser »

Hello again,

Well I have tried all the approaches above already.
But still some probelm remain:
After doing a renderoneframe or a renderwindow->update() in a paintevent-method of a qwidget
the rest of the qwidget drawing functions seem to be ignored.
so i cant use some qpainter drawing code to overdraw ogre-content.
is that the same on ohter platforms?
has anyone tried something like this?
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

Hi all, sorry for the slow reply. Busy times...
hagenkaiser wrote:Because the ogrewidget code doesnt work for me.
the result I get is:
there is an empty qwidget created and then a separate ogrewindow.
Interestingly, this is the same result that you get on Linux if you set the 'externalWindowHandle' rather than the 'parentWindowHandle'. I've never tested on a Mac, but maybe you can try swapping these around. To be honest they were just found by trial and error. I don't know why windows needs one and Linux needs the other. At some point I must look at Sinbad's MVC framework to find the correct way of setting these.
hagenkaiser wrote:besides i could ot find an ifdef in the ogrwidget for osx window creation.
I don't do Mac work so I haven't added anything. However, an earlier poster contributed a patch which added a 'Q_WS_MAC' test where the OpenGL render system is created, so presumably it was working on Mac at one point. Make you you have the latest code from subversion if you are missing this.

Sorry I can't help much, but if you can get it working without changing the architecture too much I'll be happy to accept a patch.

I'm away for a week now, but I'll check back then.
hagenkaiser
Kobold
Posts: 33
Joined: Tue May 01, 2007 11:21 am

Re: QtOgre Application Framework - Now using Qt 4.5

Post by hagenkaiser »

the code i tried is from ogreaddons svn. no qwsmac there.
the parentwindow works indeed.
i surely coul do the patch to get it basically working, but i must confess i have never done a patch so
dont really know the process.

but again:
has somone tried to overpaint the renderwindow with qts qpainter facilities?
does this work on any platform?(linux/windows)

cheers
hagen

p.s sorry, cant shift-keypress got to hold my baby-son,sitting on my lap with the other hand
:)
extrakun
Gnoblar
Posts: 7
Joined: Fri Nov 03, 2006 5:11 pm

Re: QtOgre Application Framework - Now using Qt 4.5

Post by extrakun »

Hi,

I have just grab the latest OtOgre Application Framework from SVN and create the project files with CMake. Unfortunately, it crashes whenever I try to run demo.exe. The error is:

Debug Assertion Failed!
Program: ....
File: C\Program Files\Microsoft Visual Studio 8\VC\Include\xtree Line 245

Expression: map/set iterator not dereferenceable

The log file is:
[source}
...snipped
04:44:14 pm - Added resource location './media/models' of type 'FileSystem' to resource group 'General'
04:44:14 pm - Added resource location './media/textures' of type 'FileSystem' to resource group 'General'
04:44:14 pm - Added resource location './media/materials' of type 'FileSystem' to resource group 'General'
04:44:14 pm - Parsing scripts for resource group Autodetect
04:44:14 pm - Finished parsing scripts for resource group Autodetect
04:44:14 pm - Parsing scripts for resource group General
04:44:14 pm - Parsing script Examples.program
04:44:15 pm - Parsing script Jaiqua.material
04:44:15 pm - Parsing script Robot.material
04:44:15 pm - Parsing script SkyBox.material
04:44:15 pm - Finished parsing scripts for resource group General
04:44:15 pm - Parsing scripts for resource group Internal
04:44:15 pm - Finished parsing scripts for resource group Internal
[/source]

It seems that there is something wrong just between parsing scripts for resource group internal...any idea what have I done wrong and what I can do to fix the problem?

On Edit: I did some debugging and it seems that this line:

loadScene("media\\scenes\\test.scene");

at line 42 in DemoGameLogic is enter before the crash...my theory would be that the scene file is not loaded at all...
extrakun
Gnoblar
Posts: 7
Joined: Fri Nov 03, 2006 5:11 pm

Re: QtOgre Application Framework - Now using Qt 4.5

Post by extrakun »

Eh, ah, test.scene is empty - it's blank. Is it supposed to be this way?

Edit: I have grabbed the latest version from the SVN (re-downloaded it) but it is now crashing on this line:

mSceneManager->setSkyBox(true, material.toStdString(), distance, drawFirst);

(line 316, DotSceneHandler.cpp)

The exception is

Unhandled exception at 0x7c812afb in Demo.exe: Microsoft C++ exception: Ogre::InvalidParametersException at memory location 0x00e0eb60..
extrakun
Gnoblar
Posts: 7
Joined: Fri Nov 03, 2006 5:11 pm

Re: QtOgre Application Framework - Now using Qt 4.5

Post by extrakun »

Gah, I have solved the problem...it's a faulty download from the SVN. Sorry...
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

hagenkaiser wrote:the code i tried is from ogreaddons svn. no qwsmac there.
the parentwindow works indeed.
i surely coul do the patch to get it basically working, but i must confess i have never done a patch so
dont really know the process.
If you can't work it out then just send me the modified .cpp file and I'll do a local diff.
hagenkaiser wrote:but again:
has somone tried to overpaint the renderwindow with qts qpainter facilities?
does this work on any platform?(linux/windows)
No, I haven't really tried this. Drawing other Qt windows on top seems to work ok though.
extrakun wrote:Gah, I have solved the problem...it's a faulty download from the SVN. Sorry...
So it's all working now? Sorry for the slow reply, I've been away for a few days.
Ralith
Gnoblar
Posts: 11
Joined: Sun Mar 18, 2007 7:06 am

Re: QtOgre Application Framework - Now using Qt 4.5

Post by Ralith »

Hey, I'm trying to get the demo to run on a Linux system. I had to make a few changes (jaiqua.mesh was referred to as Jaiqua.mesh, and the same for robot.mesh, which of course doesn't work on a case sensitive filesystem, the hardcoded render system lib path was wrong, and the loadScene call had to be changed to use forward slashes) but I did manage to get it to build and run. However, the Qt windows it creates are completely separate from the Ogre render window, except for the FPS counter, and manipulating the render window in certain ways makes even that pop out. This and the lack of transparency support for systems without a compositing WM lead me to wonder: are the Qt windows actually being drawn into the OpenGL context, or just drawn on top of it through the usual mechanisms?
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

Ralith wrote:However, the Qt windows it creates are completely separate from the Ogre render window, except for the FPS counter, and manipulating the render window in certain ways makes even that pop out. This and the lack of transparency support for systems without a compositing WM lead me to wonder: are the Qt windows actually being drawn into the OpenGL context, or just drawn on top of it through the usual mechanisms?
Correct, the Qt windows are simply being drawn on top of the Ogre window. It would be nice to have them drawn straight into the OpenGL context but I didn't manage to achieve this under Qt 4.4. You can read about my efforts here: http://www.ogre3d.org/forums/viewtopic.php?t=42733

However, there have been some changes with Qt 4.5 which might make this easier, such as the addition of the OpenGL render system. I haven't looked into this though, and don't have any plans to for the foreseeable future.
User avatar
iio
Gnoblar
Posts: 19
Joined: Wed Jul 30, 2008 3:28 pm

Re: QtOgre Application Framework - Now using Qt 4.5

Post by iio »

Were you able to keep the drag'n'drop creation system from the QtCreator or did you have to create everything by hand?
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

iio wrote:Were you able to keep the drag'n'drop creation system from the QtCreator or did you have to create everything by hand?
I'm not sure what you mean by this. QtOgre doesn't implement drag and drop, and I've never used QtCreator...

[Edit:] Ignore this, and read my post below.
Last edited by PolyVox on Thu Jun 18, 2009 8:42 pm, edited 1 time in total.
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: QtOgre Application Framework - Now using Qt 4.5

Post by jacmoe »

QT Creator uses drag and drop in it's built-in QT Designer.
But, since you've never used it.. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

Sorry, I see what you mean. I didn't use Qt Creator, but I did use Qt Designer. You can build custom widgets in Qt Designer and then add then to your QtOgre project. You don't need to build them by hand. I guess you could use QtCreator instead, but I haven't tried it.
juancrobles
Gnoblar
Posts: 2
Joined: Mon Jun 22, 2009 5:02 pm

Re: QtOgre Application Framework - Now using Qt 4.5

Post by juancrobles »

Hi

last weekend i tested ogre in general and trying compile QtOgre Framework in QtCreator and here is the result (attached zip), the zip contains a set of .pro files to use with qmake... this has made on windows, but must compile on linux too...
requires OgreSDK insalled on c:\OgreSDK or you can modify the OGREHOME variable in settings.pro.. aslo can be compile debug and release versions of QtOgre library and Demo application, the application has a catch, i don't know while, for some reason dont switch to debug version of ogre plugins... so if you want try a debug compile must rename/replace the plugins.cfg with plugins_d.cfg in Demo directory...

if you want compile directly with qmake just do
>qmake debug/release
>mingw32-make

NOTES:
you must have in path enviroment variable the "C:\OgreSDK\bin\debug" or "C:\OgreSDK\bin\release" in order to run Demo.exe aslo you can copy the dll's to Demo directory
to install jus unzip in root QtOgreFramework.
Attachments
QtOgreFramework.zip
.pro files to compile QtOgreFramework with qmake/QtCreator
(2.37 KiB) Downloaded 479 times
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

Thanks! I have added these files to the SVN repository - hopefully they will be useful for somebody. Is your name Juan Crobles? If so I will add you to the credits file as a contributor.
juancrobles wrote:the application has a catch, i don't know while, for some reason dont switch to debug version of ogre plugins... so if you want try a debug compile must rename/replace the plugins.cfg with plugins_d.cfg in Demo directory...
I'm pretty sure QtOgre doesn't use the plugins.cfg file - both the Direct3D and OpenGL plugins are loaded in the Application::loadRenderSystemsFromPlugins() function. But maybe Ogre automatically loads this file, I'm not entirely sure...
juancrobles
Gnoblar
Posts: 2
Joined: Mon Jun 22, 2009 5:02 pm

Re: QtOgre Application Framework - Now using Qt 4.5

Post by juancrobles »

Hi!, yes is my name and thanks...
well i include the plugins file because when try run, return me a error, because don't find the plugins.cfg file, but is posible this caused by the enviroment on my compilation, only testing to be sure...
User avatar
Karan
Halfling
Posts: 62
Joined: Wed Sep 17, 2008 1:59 pm
Location: Berlin, Germany

Re: QtOgre Application Framework - Now using Qt 4.5

Post by Karan »

I stumbled upon this today: Widgets enter the third dimension: WolfenQt. Really awesome :D
The 3D scene is 'only' drawn with Qt (QGraphicsItem), but look at the author's comment about pure OpenGL/Direct3D drawing:
From Blog comment section wrote:
Benjamin Arnaud wrote:...
Now two questions remains:
- Are the performance good?
- Will this ever be possible in Direct 3D?
...
sroedal wrote:Benjamin: The performance is surprisingly good if you use the item coordinate cache mode and make sure that all the widgets aren’t updating all the time. Currently even the walls/floor/ceiling are graphics items, but in only the widgets would have to be. It could be possible to use pure OpenGL/Direct3D drawing and just use graphics view for event translation, or maybe do event translation on your own as well if you have specific requirements. I don’t see why you couldn’t do something like this in Direct3D but it might require more work and doing more stuff outside of graphicsview than with OpenGL.
So an in-game Qt GUI that works cross-platform, with OpenGL+Direct3D, supports transparency and has good performance seems quite feasible, doesn't it?
I'm not sure I understood everything about the new Qt 4.5 stuff correctly, but couldn't you just render the individual widgets to images (QPixmap/QImage) and then use render-to-texture to put them on the walls (or wherever you want them)? And if you just want a normal flat GUI you could render all widgets to one image and overlay them with a full-screen quad. Am I missing anything? Because that sounds quite easy :)
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

Yeah, that WolfenQt stuff looks pretty cool. I did a lot of investigation into 'properly' embedding Qt into Ogre (and vice-versa) in this thread:

http://www.ogre3d.org/forums/viewtopic.php?t=42733

But unfortunatly I never really got it to work, and just overlaying is sufficient for my purposes so I haven't really pushed it any further. I think it will have got easier with Qt 4.5 though.
User avatar
Karan
Halfling
Posts: 62
Joined: Wed Sep 17, 2008 1:59 pm
Location: Berlin, Germany

Re: QtOgre Application Framework - Now using Qt 4.5

Post by Karan »

Yeah, I read the whole thread before. I think I'm gonna try out what I wrote here when I find the time.
Post Reply