Qt 5.0 - Is it a viable option for 3D game / application development

Started by
4 comments, last by BitMaster 11 years ago

I recently noticed that there is a new release of Qt. I don’t have any personal experience developing games or applications with it, but I’m looking for an API or framework that will simplify creation of GUI for my applications, written in C++ & OpenGL. At this stage I’m less worried about cross-platform, but this is something that I could benefit from in future.

I understand that Qt's real strength lies in its flexibility and cross-platform functionality. Obviously this comes with a trade-off; less control over the main loop.

I have spent a few days pouring over articles and blogs and not really seen much about Qt 5 and the rest of the information regarding Qt seems to point to it not being a great choice for 3D games. I wanted to get a discussion going as most of the information I’ve found seems to be quite dated.

So I guess my questions are:

  • Is Qt a viable for 3D application/games development?

  • For instance, if I wanted to make a 3D application that had multiple viewports with relevant GUI and a viewport rending a relatively large amount of polys (say 6 million) with some degree of 3D texturing and multiple passes / shaders. Could I use Qt?

From what I’ve read, using GUI elements of Qt seem to take a lot of CPU time. I recognise that there are optimisations you can do within your program, but Qt’s GUI is a big plus and I wouldn’t really want to use Qt if I couldn’t take advantage of it.

Advertisement

QT is great for GUI development, if you keep the GUI widgets outside the OpenGL widget things will perform well, trying to render the GUI widgets using OpenGL is possible but it will have a fairly big negative impact on your rendering performance and a game oriented OpenGL gui library would be a far better choice.

You can use QT without the GUI portion to create a OpenGL window and handle input for a game and it will perform well as long as you take control of the event loop manually (rather than relying on QApplication handing it for you) but if you go down that route something like SDL or SFML will be far easier to work with.

Thus: For a game, i'd recommend you go with something like CeGUI instead. For things like level editors where you don't need perfectly smooth framerates or where you can keep most GUI elements outside the OpenGL widget/window QT works really well.

[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

1. For the tools side of things, Qt is great. It's not going to be all that good as the basis for a game engine though!

2. Yes. As an example, Maya is built on top of Qt.

Qt is great for making GUI, so keep it close for your game editor, especially if C#/.NET is not an option.

For a game though, I would avoid it personally. For all its advantages, Qt is bloated and what was once a GUI library is now an entire framework with a breadth that rivals that of the .NET or Java library. Might sound useful to have a wide library for a game, but in reality a lot of the non-GUI related utilities are already provided (and usually in a much better way!) by boost and/or the C++ standard library anyway, so you don't really need it if you're not going to use Qt for heavy GUI building.

Now, you absolutely can use Qt for a game, and it's going to work, but you're looking to include a massive DLL that you'll barely use. I think it'd be better advised to use something like SDL to get a base game windows and collect basic events if you absolutely want cross-platform ability; that's exactly what it's made for, and for having used it extensively in the first versions of my RPG I can say that it works really smoothly.

You can take a look onto the QMl-Stuff, wich was completly rewritten for the 5.0 release. As far as I know some guy's are using this for 3D-application. You can also use GLSL-shadercode here. But don't ask me how good the performance is. I am just using QML for the UI for embedded.

Kimmi

A complicate solution may indicate a not understood problem.


[twitter]KimKulling[/twitter]

Now, you absolutely can use Qt for a game, and it's going to work, but you're looking to include a massive DLL that you'll barely use.

Actually, it's not that bad. Thanks to the modularization you can get away with quite a bit of pick-and-choose. I did a quick test a while back and ended up with about 20MB worth of DLLs/support files to slug around for a likely use case. Definitely not tiny but very far from the full Qt-treatment.

This topic is closed to new replies.

Advertisement