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
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Post by PolyVox »

Just a quick update - the code is now available from Ogre Addons in the 'QtOgreFramework' directory.
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

PolyVox wrote:
nikki wrote:Wait a minute... You're saying that the Qt widgets are are shown 'inside' Ogre? So we can use it for in-game GUI?
Almost. My original aim was to embed Qt widgets into Ogre, but it turned out to be much simpler to overlay the widgets on top of Ogre and let the desktop handle the compositing/transparency. But yes, you can use it for an in-game GUI. In fact I wrote it to be used as an in-game GUI for my volumetric game engine
So its still in the same window right? Or is it like Window on the Ogre window? Also, does Qt alow 'game-like' skinning? Because I don't think we'd like in-game menu's looking like Qt's usual theme. ;)
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Post by PolyVox »

nikki wrote:So its still in the same window right? Or is it like Window on the Ogre window?
Look at the FPS widget in the screenshots, for example. This is technically a separate Qt window which has simply been placed above the main Qt window (which in turn is holding the Ogre widget). However, the title bar has been removed and mouse handling has been overridden so that the user can drag it around by clicking anywhere, but they can't drag it outside the window.

So as far as the user can tell, it is 'inside' the main window.
nikki wrote:Also, does Qt alow 'game-like' skinning? Because I don't think we'd like in-game menu's looking like Qt's usual theme. ;)
Absolutely :wink:

Image
paddy3k
Gnoblar
Posts: 20
Joined: Mon Sep 29, 2008 7:54 am

Post by paddy3k »

Hi there,

I'm new to Qt and pleased to find such a great framework for ogre!

But I have a dumb question

what do I have to do to get the source compiled under Visual Studio 2008 ?

I tried an Qt Library project, but when I want to import the header and
sourcefiles and try to compile it the following error occurs:

"Fehler 1 error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""int __cdecl qInitResources_resources(void)" (?qInitResources_resources@@YAHXZ)" in Funktion ""void __cdecl initQtResources(void)" (?initQtResources@@YAXXZ)". Application.obj QtOgre_
"

has something to do with this line in Application.cpp ?!

inline void initQtResources() { Q_INIT_RESOURCE(resources); }

Hope somebody can help :)

greets & thx for this great piece of code ! :-)

paddy
paddy3k
Gnoblar
Posts: 20
Joined: Mon Sep 29, 2008 7:54 am

Post by paddy3k »

I solved it... but another problem remains with the demo application.

I got the following error after start up the demo :

"Unhandled Exception at 0x5b0278ec (msvcp90d.dll) in QtOgre Demo.exe" (in the "xutility" class)

how to get it work ? For now, I used the .lib file. But I have both, the dll and lib. I think its just a reference problem ? So what would I have to do, to use the QtOgre dll correctly in the demo app ???

greetings,
paddy
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Post by PolyVox »

Hi, for building the source you should install and use CMake, rather than create project files yourself. Is this what you did? Of course you probably can create them yourself, but I'm not sure what settings you need to use.

Once CMake is installed, you should be able to change to the root QtOgreFramework folder and run 'cmake .' to create the solutions/projects.

As for the runtime error, what happens when you run it in debug mode?
paddy3k
Gnoblar
Posts: 20
Joined: Mon Sep 29, 2008 7:54 am

Post by paddy3k »

ahh, cmake is for making the project files ! I didn't know that :)
I will try that out today and post a reply :)

thx polyvox !
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Post by PolyVox »

Yeah, it's an extra hoop to jump through but the advantage is that you can generate project files or make files for many different platforms and IDEs.

I really should write some user documentation for this framework though, and maybe I have a chance to do so after Christmas.
User avatar
milliams
Gremlin
Posts: 172
Joined: Fri Feb 16, 2007 1:47 am
Location: Portsmouth, UK
Contact:

Re: QtOgre Application Framework - Now in Ogre Addons

Post by milliams »

And now that Qt 4.5.0 onwards will be released as LGPL, this will open up a lot of opportunities for spreading the use of Qt in indie game projects.
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Re: QtOgre Application Framework - Now in Ogre Addons

Post by nikki »

milliams wrote:And now that Qt 4.5.0 onwards will be released as LGPL, this will open up a lot of opportunities for spreading the use of Qt in indie game projects.
What? That's great news! Qt is an awesome framework, and it being LGPL is going to make it even better.

(not that I'm planning to use it commercially soon, but anyway)

(I wonder what impact this'll have on KDE...)
User avatar
milliams
Gremlin
Posts: 172
Joined: Fri Feb 16, 2007 1:47 am
Location: Portsmouth, UK
Contact:

Re: QtOgre Application Framework - Now in Ogre Addons

Post by milliams »

nikki wrote:
milliams wrote:And now that Qt 4.5.0 onwards will be released as LGPL, this will open up a lot of opportunities for spreading the use of Qt in indie game projects.
...

(I wonder what impact this'll have on KDE...)
Likely very little impact any time soon.The core KDE libraries have always been LGPL. To date there have been practically no licensing issues holding us back in any real way. Of course we welcome the decision since it will allow us to get an patches we have integrated more easily (though this is more due to the opening up of the development system than the license change itself).

The only real change this will have is that perhaps more proprietary software will be making use of kdelibs (without having to pay Trolltech/Nokia anything) but as far as the desktop, there will likely be no change. More proprietary software using kdelibs doesn't really help us that much since we really want more open source projects. The rest of the KDE project is still released as GPL 3.
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 in Ogre Addons

Post by PolyVox »

milliams wrote:And now that Qt 4.5.0 onwards will be released as LGPL, this will open up a lot of opportunities for spreading the use of Qt in indie game projects.
Yep, this is indeed awesome news :-)

For anyone interested, I have now got a basic DotScene loader working using Qt's SAX API. I'm only implementing handlers for the node types I'm interested in for the Thermite3D engine (entities, lights, I'll add other things as I need them), but the code is pretty straightforward so it should be easy to add handlers for other nodes if you wish. I'm also trying to keep it extensible so that you can add your own XML node types (for example, Thermite3D will define a 'volume' node, which is not part of the DotScene standard).
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Re: QtOgre Application Framework - Now in Ogre Addons

Post by nikki »

QtOgre also helps in embedding Ogre into a Qt GUI (like for tools), right?
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 in Ogre Addons

Post by PolyVox »

To an extent, but you'll probably find it's overkill for that. You see, the process of embedding Ogre into a Qt window is actually pretty simple - you just get the window handle from Qt and pass it to Ogre when you create the Ogre::RenderWindow. Within the QtOgreFramework this is handled by the QtOgreWidget, which was once based on code from the Wiki. If you want to make something like a level editor you probably just want to extract this class.

The rest of the framework handles things like logging, the initial configuration dialog, DotScene loading, and various other things you might not need.

And yes, it should work on Linux (I thought you asked that but I can't see it now). But milliams has used it more on Linux than I have.
kkrizka
Gnoblar
Posts: 7
Joined: Thu Feb 05, 2009 7:03 am

Re: QtOgre Application Framework - Now in Ogre Addons

Post by kkrizka »

Has anyone tried the QtOgre framework with the latest Qt 4.5-beta1? When I try the Demo application, the 3D scene flickers a lot. I think that this might have to do with the new Direct3D acceleration introduced in the 4.5 release. More info here: http://labs.trolltech.com/blogs/2008/10 ... -the-blit/
I tried using both the DirectX and raster graphics systems, both of which resulted in the 3D scene flickering. However when I used the native graphics system, everything worked perfectly.
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 in Ogre Addons

Post by PolyVox »

I haven't tried it I'm afriad. I will upgrade at some point but probably not until it comes out of beta. Skim reading that link it seems that OpenGL and Direct3D can now be used as the backend for Qt - perhaps the flickering is being caused by both Qt and Ogre trying to swap the front and back buffers? So the buffers get swapped twice per frame? That's a bit of a stab in the dark though, I'll have to look into it properly at some point.
banal
Halfling
Posts: 59
Joined: Tue Jan 22, 2008 11:06 am

Re: QtOgre Application Framework - Now in Ogre Addons

Post by banal »

Hi PolyVox

Thanks for sharing this addon. I'm really interested in trying this, since i already used Qt for my Diploma and would like to use it in combination with Ogre. I'm currently trying to setup a development environment on my Mac (OS X 10.5). I'm using Eclipse CDT and the OgreSDK (1.6.1 installer for mac). I'm able to compile Ogre Applications as well as Qt Applications. I'm struggling getting the QtOgreFramework to compile though. Sadly, my CMake knowledge is rather limited, not to say "nonexistant" :) Maybe some of you guys can help me out.
Here's what i'm getting as output when running cmake:

Code: Select all

CMake Error at cmake/modules/FindOGRE.cmake:93 (MESSAGE):
  Could not find OGRE
Call Stack (most recent call first):
  CMakeLists.txt:6 (FIND_PACKAGE)
I already had a look at the FindOGRE.cmake file and i guess one would have to add a special case for Mac Os (Win/Unix/Mac). Or am i wrong? Did anybody compile the QtOgreFramework on a Mac?

Any help is greatly appreciated. Thanks.
User avatar
milliams
Gremlin
Posts: 172
Joined: Fri Feb 16, 2007 1:47 am
Location: Portsmouth, UK
Contact:

Re: QtOgre Application Framework - Now in Ogre Addons

Post by milliams »

banal wrote:I already had a look at the FindOGRE.cmake file and i guess one would have to add a special case for Mac Os (Win/Unix/Mac). Or am i wrong? Did anybody compile the QtOgreFramework on a Mac?

Any help is greatly appreciated. Thanks.
Basically, yes. A special case for searcing for OGRE on the Mac is needed in FindOGRE.cmake (and also any other Find##.cmake file in that same folder). Neither Polvox or I have access to a Mac to test anything like this and that is why nothing has been done on it yet. However, if you are able to get anything working, we would welcome a patch.

Some resources to get you started would be CMake_Platform_Dependent_Issues, CMake:How_To_Find_Libraries, CMake_HowToFindInstalledSoftware and CMake:HowToUseExistingOSXFrameworks.
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 in Ogre Addons

Post by PolyVox »

Agreed with what milliams said. But you might find it easier to just hard-code the paths to start with just to see if it works...
banal
Halfling
Posts: 59
Joined: Tue Jan 22, 2008 11:06 am

Re: QtOgre Application Framework - Now in Ogre Addons

Post by banal »

Thanks for your replies

I managed to get cmake to work by using the following FindOGRE.cmake module:
http://d-collide.ematia.de/trac/browser ... e?rev=1683

It seems to rely on CMakeFindFrameworks which i found here:
https://svn.zib.de/lenne3d/tools/cmake/ ... orks.cmake

The cmake issue seems to be resolved, now i get some compiler errors. I'll investigate further and maybe even provide a patch for your current cmake file(s).
banal
Halfling
Posts: 59
Joined: Tue Jan 22, 2008 11:06 am

Re: QtOgre Application Framework - Now in Ogre Addons

Post by banal »

Hello all
I was able to compile the QtOgre library and the demo. The problem with the current ogre mac release is, that the user can place it anywhere he wants (at least when using the binary distribution). It no longer installs to "/Library/Frameworks" or any other path where the CMakeFindFrameworks script is looking for frameworks. I guess one would have to add a command-line parameter to the cmake script to specify the OgreSDK directory.
There seems to be another problem with the ogre plugins. When i run the demo i get the following message:
plugins.cfg not found, automatic plugin loading disabled.

Then, the settings window doesn't allow me to select a rendering subsystem.
I already tried to put the plugins.cfg to the Demo folder, to no avail. I'll have a closer look at your sources, maybe i'll find a solution to 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 in Ogre Addons

Post by PolyVox »

banal wrote:...I guess one would have to add a command-line parameter to the cmake script to specify the OgreSDK directory...
millimas knows a lot more about CMake than me, but under windows I set an environment variable to point to where Ogre is installed and then check for that from within the FindOGRE.cmake file. Maybe you can do something similar?
banal wrote:There seems to be another problem with the ogre plugins. When i run the demo i get the following message:
plugins.cfg not found, automatic plugin loading disabled.
Then, the settings window doesn't allow me to select a rendering subsystem.
It doesn't use the plugins.cfg, render system plugings are found and loaded in the Application::loadRenderSystemsFromPlugins() function. I believe the message you see comes from Ogre (not the QtOgre framework) and isn't actually a problem. As I recall :? Anyway, I notice there is much platform specific code in loadRenderSystemsFromPlugins() but nothing for Macs. It's pretty basic to fill in, though.
banal
Halfling
Posts: 59
Joined: Tue Jan 22, 2008 11:06 am

Re: QtOgre Application Framework - Now in Ogre Addons

Post by banal »

Hi PolyVox

I created a patch for the QtOgreFramework.
Changes:
* CMake should now work on Mac too, as long as you have an environment variable "OGRE_HOME" pointing to the OgreSDK Folder and one named "QTDIR" pointing to the Qt install dir (eg. /usr/local/Trolltech/Qt-4.4.3)
* Patches Application.cpp so that it loads the OpenGL Rendering Subsystem on mac

You can download it here:
http://bummzack.ch/misc/MacPatch.txt.zip

Sadly, the demo crashes whenever i click something.. apparently something goes wrong with input-handling. I'll post here if i find a solution to 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 in Ogre Addons

Post by PolyVox »

Thanks! I will apply the patch as soon as I get a chance. Not sure about the crash though - I don't think I've experienced that...
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 in Ogre Addons

Post by PolyVox »

Sorry, just got round to looking at this. The changes in Applicatrion.cpp and FindOgre.cmake look good - but what is the purpos of the new code in CMakeLists.txt?

Code: Select all

IF (APPLE)
    IF (EXISTS ${QT4_LIBRARY_DIR}/QtCore.framework)
      SET(QT_USE_FRAMEWORKS ON
        CACHE BOOL "Set to ON if Qt build uses frameworks.")
    ELSE (EXISTS ${QT4_LIBRARY_DIR}/QtCore.framework)
      SET(QT_USE_FRAMEWORKS OFF
        CACHE BOOL "Set to ON if Qt build uses frameworks.")
    ENDIF (EXISTS ${QT4_LIBRARY_DIR}/QtCore.framework)
    
    MARK_AS_ADVANCED(QT_USE_FRAMEWORKS)
ENDIF (APPLE)
I only ask because there is no corresponding code for Windows/Linux. Is it related to using the CMake GUI (this is something I haven't tried yet...)?
Post Reply