Page 1 of 12

QtOgre Application Framework - Now using Qt 4.5

Posted: Mon Nov 10, 2008 1:41 am
by PolyVox
Hi guys,

This is a preview release of my new QtOgre framework. It is similar in concept to the ExampleApplication framework which comes with Ogre, but it is built on Qt and with a few more features. First, some screenshots:

Image

Image

And transparency in action:

Image

Its features include:
  • A configuration dialog:
    • Contains a 'Graphics configuration widget' to configure Ogre.
    • Support for rendering systems, resolution, etc.
    • All config settings stored to an .ini file
  • A log viewer:
    • Syntax highlighting and filtering
    • Qt's message handler are redirected to this system
    • Ogre's logs are also redirected
  • A Frames Per Second widget
    • Actaully a Qt Dialog
    • Window decorations turned off
    • Custom mouse handling so it can be dragged around
  • Simple to use interface:
    • Just inherit from 'GameLogic' class and override the desired functions
    • Demo is included which shows basic usage
    • Very few assumptions made so you have maximum flexibility
  • Support for transparent windows on some systems (Vista, Linux with Compviz)
Most importantly, it is very extensible. You can create your own widgets in Qt and add them to the window. You can create new logs and they appear with the rest. And you can define new 'settings' pages for your in-game configuration, these appear as tabs in the settings dialog.

When programming in this framework you naturally have access to the whole Qt API for tasks such as XML parsing, network support, sound support, etc.

The project is intended to form the basis for the next version of my Volumetric Game Engine. I will be porting this across over the next couple of weeks and will no doubt find places where the framework has to change, so please don't consider it final. There are also some missing features (such as some of the config options not actually doing anything).

However, I will keep this separate from my game engine so that it can be used by other interested people. I would also like to put it in Ogre Addons, if people feel this would be useful?

Download

You can download a prebuilt demo for windows here: http://www.david-williams.info/linked_f ... ebuilt.zip

And the Windows/Linux source code (under the liberal ZLib license) is available from Ogre Add-ons. The direct Subversion URL for this project is: https://ogreaddons.svn.sourceforge.net/ ... eFramework

Let me know what you think!

Posted: Mon Nov 10, 2008 1:57 am
by Nauk
Simply: Wow :)

Posted: Mon Nov 10, 2008 1:58 am
by romulo
Awesome work! Congratulations, it is a step further in multi plataform compatibility and acceptance. I would love to see now Qt Inside ogre! xD

Posted: Mon Nov 10, 2008 2:19 am
by enligor
That's just WOW :shock: ! Can't say enough how amazing and useful this addition is. Being a cross-platform engine, it makes sense for Ogre to have Qt or GTK+ with it (although my favourite has always been KDE/Qt)!
Thnx once more for you implementation!
Must say, the code is very nicely written, and runs very swiftly too. Shouldn't this (once it's finalized, of course) be included with the Ogre core?

P.S. actually, for the past few weeks this is something I was trying to write - a Qt framework for Ogre, but yours is way ahead of mine. So, thnx once more, and if I could help with anything, I'd be glad to. :wink:

Posted: Mon Nov 10, 2008 11:13 am
by PolyVox
Thanks guys! I'm glad you like it :)
romulo wrote:Awesome work! Congratulations, it is a step further in multi plataform compatibility and acceptance. I would love to see now Qt Inside ogre! xD
You mean like in this thread?

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

Actually I never really got it to work. But my main aim in using that approach was to be able to use the transparent widgets, and it has proved to be much simpler to just let Vista/Compviz handle this. This probably means the transparency won't work on Windows XP (although I haven't tried it).

Incidentally, if you want to test transparency then just edit settings.ini and change the 'DefaultWindowOpacity' to something less than '1.0'.
enligor wrote:Must say, the code is very nicely written, and runs very swiftly too. Shouldn't this (once it's finalized, of course) be included with the Ogre core?
Thanks! It still needs some tidying but I think the design is pretty decent and easy to use. It won't go into Ogre core as we won't want to make Ogre dependant on Qt, but I think it could usefully go into Ogre Addons. I will contact someone about it.

I will aim to write a Wiki page on it as well.

Posted: Mon Nov 10, 2008 11:44 am
by FrameFever
why didn't you use qmake?

Posted: Mon Nov 10, 2008 12:17 pm
by PolyVox
FrameFever wrote:why didn't you use qmake?
No real reason - I'm just using CMake for my game engine (which will soon be ported to this framework) so I know how it works. I expect it's possible to have both QMake and CMake scripts though, so if anyone wants to contribute one I'll happily add it. Or maybe I do it myself at some point...

Posted: Mon Nov 10, 2008 1:09 pm
by Brocan
Woah! You did it! Congrats :D

Posted: Mon Nov 10, 2008 1:27 pm
by sinbad
Hey, really nice work. I'll happily give you a spot in ogreaddons (assuming the license is open source), please shoot me an email to organise.

Posted: Mon Nov 10, 2008 3:02 pm
by iloseall
Great work! QT for framework,QT for UI.
:shock:

Re: QtOgre Application Framework

Posted: Mon Nov 10, 2008 4:49 pm
by ppClarity
PolyVox wrote:And the Windows/Linux source code (under the liberal ZLib license) is available here: http://www.david-williams.info/linked_f ... Source.zip
ObWarning: Qt is dual licensed, GPL or their own commercial license. I would be very (pleasantly) surprised if you were able to negotiate something Zlib or even LGPL compatible.

http://doc.trolltech.com/4.4/opensourceedition.html

Posted: Mon Nov 10, 2008 7:07 pm
by jacmoe
You cannot release it other than GPL, I'm afraid.

I wouldn't use QT on Windows anyway.

This is just great looking, Polyvox! :)

Posted: Mon Nov 10, 2008 7:59 pm
by PolyVox
Regarding the licensing issue, my copy of Qt came with a file called GPL_EXCEPTION.txt which contains (among other things) the following:
Additional rights granted beyond the GPL (the "Exception").
.
.
.
A) Your Software is licensed under one of the following licenses:


License name Version(s)/Copyright Date
Academic Free License 2.0, 2.1, 3.0
Apache Software License 1.0 or 1.1
.
.
.
X11 License X11R6.6
Zlib/libpng License (as set forth in the addendum file) <========
Zope Public License 2.0, 2.1
So actually I don't think it's a problem. But let me know if you disagree, I don't actually mind using the GPL i was just trying to be less restrictive :)

@sinbad - A spot in Addons would be great, I will email you.

Posted: Mon Nov 10, 2008 8:22 pm
by Kerion
And thus you see why the GPL is considered bad by many open sourcers, it's incredibly viral. Discussion for another time, I'm sure...but it's bad when someone can't release their software under the license of their choosing because the GPL has "infected" their dependencies.

Posted: Mon Nov 10, 2008 8:27 pm
by Paladi
As I said you before, very nice work!!

When I have time I will look closer to it.

Posted: Mon Nov 10, 2008 9:12 pm
by nikki
Wait a minute... You're saying that the Qt widgets are are shown 'inside' Ogre? So we can use it for in-game GUI?

Nice work! :)

Posted: Mon Nov 10, 2008 9:18 pm
by jacmoe
If you wish to use the Qt Open Source Edition, you must contribute all your source code to the open source community in accordance with the GPL or Qt Software's GPL Exception when your application is distributed.
Taken from here:
http://trolltech.com/products/appdev/li ... ce-license
That means that you need to completely separate your engine from your tool!
If you intend to stay out of the GPL, of course. :wink:

Posted: Mon Nov 10, 2008 9:25 pm
by jacmoe
Software developed with the Qt Open Source Edition is always open source software, i.e. it can only be distributed under a open source software license. In particular, all the source code for all the modules your software is based on, regardless of whether they have been written by you or by others, must be open source software (because of the "viral" nature of the GPL). This is part of our commitment to the open source software community, and enables those who contribute to the open source software pool to do so without paying license fees.

Posted: Mon Nov 10, 2008 9:30 pm
by jacmoe
Right, I found it:
As a special exception, you have permission to link this program
with the FOO library and distribute executables, as long as you
follow the requirements of the GNU GPL in regard to all of the
software in the executable aside from FOO.
That's the QPL license for you. :wink:

Posted: Mon Nov 10, 2008 9:57 pm
by Nauk
so basically we are talking GPL with runtime exception like ETM?

Posted: Mon Nov 10, 2008 10:24 pm
by jacmoe
Well. No.
The way I read it is that you must opensource your QT powered applications, but not your own linked in code.
It is not viral in that sense.
But, closed source: no. :wink:

In that regard, it is not like GPL with the runtime exception.

Posted: Mon Nov 10, 2008 10:44 pm
by Nauk
understand, the other way around then :)

Posted: Tue Nov 11, 2008 12:24 am
by PolyVox
There is no need to worry - the ZLib license is significantly more liberal than the GPL while still being GPL compatible. You only need to worry about whether you satisfy Qt's license requirements. There are basically two options:
  1. You are using the open source version of Qt under the GPL (+ exceptions) license. In this case you have to release you code under the GPL, or one of the other licenses outlined in the exceptions file. You can still use my code, because it is GPL-compatable as stated here: http://www.gnu.org/philosophy/license-l ... leLicenses
  2. You have a commercial Qt license, allowing you to release your code under any license you wish. If you want to use my code you need to adhere the terms of the ZLib license, but that is very permissive and allows commercial use.
So basically, if you decide you want to use Qt for your product (and are happy with either its commercial or open source license) then you can probably use my code.
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

Posted: Tue Nov 11, 2008 9:17 am
by d000hg
When you guys say 'GPL' do you mean LGPL (like Ogre) or the full-blown GPL?
Wouldn't incorporating anything with full GPL into Ogre mean the whole thing becomes full GPL, and screw us all over?

Posted: Tue Nov 11, 2008 10:07 am
by PolyVox
d000hg wrote:When you guys say 'GPL' do you mean LGPL (like Ogre) or the full-blown GPL?
Wouldn't incorporating anything with full GPL into Ogre mean the whole thing becomes full GPL, and screw us all over?
Qt is dual-licensed. If you are writing open source software the you can use it under the terms of the GPL (or one of the licenses listed in the exceptions file). If you are writing closed sources software then you have to purchase a commercial license from Trolltech/Nokia.

However, this QtOrge project will never be incorporated into Ogre for the reason you state. Instead it simply builds on both Qt and Ogre to provide a framework using both of them.

This project is intended for people who are already happy with the Qt licensing terms, either because they don't mind the GPL, or because they have brought a commercial Qt license. In either case the ZLib license I have chosen is compatible.