Trolltechs Qt Library and Irrlicht

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
darkliquid
Posts: 41
Joined: Sun Nov 09, 2003 10:12 am
Location: UK
Contact:

Trolltechs Qt Library and Irrlicht

Post by darkliquid »

I've been thinking about what Curious (guest) wrote about using Qt and Irrlicht together,
Curious wrote:I have a simple question. Can I use Irrlicht with Qt, maybe even using KDevelop to create a whole Qt app and then Irrlicht engine as the backdrop of the application's view?
This means that Irrlicht should not call up a window (Qt will handle this)...
Any suggestions...?
Well, I've become inspired to start work on writing an Irrlicht-enabled widget based on the OpenGL widget in Qt. From perusing through the sourcecode of both Qt and Irrlicht it has become apparent that it shouldn't be too hard. The Qt OpenGL widget accepts standard OpenGL calls as long as they are wrapped into the inherited class in a specific way. Therefore I propose that its simply a matter of writing an Irrlicht driver as a Qt OpenGL widget derived class. This shouldn't be too hard as it is simply a matter of porting the OpenGL driver to the Qt OpenGL Widgets particular format. Of course, i suspect that parts of the driver will need to be rewriten from scratch.

An alternative method I propose is instead to create an event wrapper between Irrlicht and Qt, therefore allowing Qt widgets to control Irrlicht and possibly vice-versa. This method would not allow Irrlicht to be embedded in a window as a widget however.

Anyway, what do people think? Comments, slander, nuggets of wisdom welcomed. I'll keep people posted as a make any tangible progress.
http://www.darkliquid.net - Blog, art, poetry
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

That a nice idea, but I cannot give you any help, because I am not very experienced with Linux and never tried Qt. But If you have any questions about the driver, don't hesitate to ask me.
darkliquid
Posts: 41
Joined: Sun Nov 09, 2003 10:12 am
Location: UK
Contact:

Post by darkliquid »

Excellect, thanks a lot! I'm not very good at OpenGL programming, but I've been using Linux for a looong time, so we can probably help each other out.
http://www.darkliquid.net - Blog, art, poetry
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

ok :)
just mail me, or use the forum if you like.
darkliquid
Posts: 41
Joined: Sun Nov 09, 2003 10:12 am
Location: UK
Contact:

Post by darkliquid »

Bjorn wrote:This post was supposed to be under Trolltechs Qt Library and Irrlicht topic ...:
"That Curious guest was me
really really like the idea and I can imagine all Linux users do as well. Key feature though would be though to rather inherit from the opengl widget in order to use irrlicht in same window. This does mean though though that alot of code needs to be rewritten (cause QT OpenGL widget is a wrapper itself).
Will be glad to help of course ..."
Yeah, I completely agree. I've been playing around with some code, shifting all the OpenGL Driver stuff from Irrlicht into a make shift class that inherits from QGLWidget and IVideoNull (i think thats the one ;) ), so far I haven't got anywhere (lots of coding to do first) but as I get further along I'm becoming more convinced that using a QGLWidget might be a bad idea, I'm thinking it might be better to rewrite the QGLWidget entirely and wrap Qt code straight to Irrlicht instead of QextIrrlicht->QGLWidget->Irrlicht.

That reminds me, I've named the project at home QextIrrlicht, in the same mind as QextScintilla was named, you like?

Anyway, what do you think? Have you tried out any code yet? Do you have a design for the coding modal?
http://www.darkliquid.net - Blog, art, poetry
Bjorn
Posts: 3
Joined: Tue Nov 18, 2003 8:44 am

Post by Bjorn »

Well, to be quite honest, though I do know Qt quite well, OpenGL is a very new concept to me.
Writing a new GLWidget will be rather difficult I believe. Remember it has to be able to communicate with the other QGLContext (etc. don't know exact name), but these objects provide alot of extra functionality and reuse with the whole Qt environment.
All in all, it is a huge task, if you have enough OpenGL experience though, the end result will be really cool...
darkliquid
Posts: 41
Joined: Sun Nov 09, 2003 10:12 am
Location: UK
Contact:

Post by darkliquid »

Well, I don't have too much OpenGL experience either :D But, most of the code can be taken from the original QGLWidget and just reworked. Saying that, I'm slowly coming along with my experiments at home, if you want to try and whip up something, we can compare some notes once we both get something working (or barely working :P).

Addendum:

I've come across something called SoQt, a Qt binding for OpenInventor and Coin3d library (I think?), by looking at the source, I may be able to work out a basic idea for an Irrlicht binding framework. Woohoo!
http://www.darkliquid.net - Blog, art, poetry
angel80
Posts: 22
Joined: Mon Feb 07, 2005 1:37 pm
Location: Paris (France)

What about QT now

Post by angel80 »

I have just a question about merging Irrlicht and Qt? have you successed to make it?
I wonder if it possible? because I'm working in an application for virtual reality room with irrlicht AND I'd like to code a stereoscopie vision, Qt giving somme function to do that easily.
Thank for your help
.: Franck :.
darkliquid
Posts: 41
Joined: Sun Nov 09, 2003 10:12 am
Location: UK
Contact:

Post by darkliquid »

I'm afraid the whole thing sort of died in it's infancy. I just didn't have enough knowledge about Qt/OpenGL/Irrlicht to do it, though I did learn a bit more about all of them in the endeavour.

I reccommend looking into GTK as a widget set instead (especially since it is more practically cross-plattform than Qt). There are simple GTKSDL widgets, and I believe there are Irrlicht SDL renderers outthere, so maybe a combination of these could be used for a simple Irrlicht within GTK wrapper?
http://www.darkliquid.net - Blog, art, poetry
Post Reply