Page 4 of 12
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Thu May 21, 2009 6:50 pm
by Moohasha
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Fri May 22, 2009 12:37 am
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.
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Fri May 22, 2009 2:28 am
by Moohasha
Dude, please watch the language on the forums.
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Fri May 22, 2009 9:38 am
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
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Fri May 22, 2009 1:14 pm
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?
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Fri May 22, 2009 3:12 pm
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
):
http://www.ogre3d.org/forums/viewtopic.php?p=258064
http://www.ogre3d.org/wiki/index.php/QtOgre
Hope that helps you out a bit.
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Fri May 22, 2009 5:07 pm
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?
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Fri May 22, 2009 10:03 pm
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.
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Sat May 23, 2009 8:41 am
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
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Mon May 25, 2009 9:57 am
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...
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Mon May 25, 2009 10:26 am
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..
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Mon May 25, 2009 11:01 am
by extrakun
Gah, I have solved the problem...it's a faulty download from the SVN. Sorry...
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Wed May 27, 2009 8:41 pm
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.
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Fri May 29, 2009 8:37 pm
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?
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Fri May 29, 2009 8:43 pm
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.
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Thu Jun 18, 2009 2:10 pm
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?
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Thu Jun 18, 2009 8:19 pm
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.
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Thu Jun 18, 2009 8:24 pm
by jacmoe
QT Creator uses drag and drop in it's built-in QT Designer.
But, since you've never used it..
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Thu Jun 18, 2009 8:40 pm
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.
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Mon Jun 22, 2009 5:55 pm
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.
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Tue Jun 23, 2009 7:55 pm
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...
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Tue Jun 23, 2009 11:54 pm
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...
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Wed Jun 24, 2009 12:18 am
by Karan
I stumbled upon this today:
Widgets enter the third dimension: WolfenQt. Really awesome
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
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Thu Jun 25, 2009 11:09 pm
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.
Re: QtOgre Application Framework - Now using Qt 4.5
Posted: Thu Jun 25, 2009 11:42 pm
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.