Irrlicht and Juce OpenGL help

Hi,

 

I've 'inherited' an application that uses the Irrlicht 3D library to display a scene.  The current UI system (and other helper systems) are horrible and I've managed to convince my boss to possibly let me switch it all to Juce (the UI is being redone from scratch anyway).  The problem is, although I've used Juce for years, I've never done anything with OpenGL so I'm a bit stuck with how to proceed.  If I can get this working in the next few days we'll be purchasing a commercial Juce license.

 

In the Irrlicht windows code you can initialise it by passing it a HWND of a previously created window.  I essentially just want to mimic what the Juce Demo is doing. (3D scene in the background, Juce components on top)

 

I've had a look over the Juce OpenGL classes but I'm still not really sure about how to put it together (OpenGL terminology is all new to me), any pointers are appreciated.  This needs to work for iPad and Android too.

 

Cheers!

Matt

 

How's the irrlicht android port these days. Has it caught up. I can see the iPad and Android versions being your main problem in this endeavour. For windows, you could arrange for the component to be a separate `ComponentPeer' and thus give its window handle to irrlicht, but for Android and iOS, i dont know how it works.

If the scene is very simple, you could consider rolling your own viewer inside Juce.

Cheers for the reply.  I'll try and get this working on Windows and then hopefully I'll know a bit more by then to attempt Android and iOS.

 

Currently the project is using Proton (http://www.rtsoft.com/wiki/doku.php?id=proton) to handle making Irrlicht crossplatform.  Basically a bunch of not very pretty code that gets an old version of Irrlicht (1.6 from 2009) working on Android and (in theory) iPad.  This project already works on Android with the old UI system. 

 

Unfortunately the scene is far from simple, otherwise I would have ditched Irrlicht altogether and just started the project from scratch.

For windows, you could arrange for the component to be a separate `ComponentPeer' and thus give its window handle to irrlicht, but for Android and iOS, i dont know how it works.

Can anyone else that knows a bit about OpenGL comment on this?  Sorry I can't really give details, I'm still trying to understand it all. (been thrown in the deep end on this one, if I can get Juce into this project though I'll be sorted)

Components in Juce do not necessarily have their own OS window handle. The `ComponentPeer' is the thing with the real window handle and Components might share the same peer. If you wanted a component with an exclusive window handle, you would somehow have to arrange it to have its own private ComponentPeer. For example, Component::addToDesktop does this, but this might not be what you want in this case.

Under Android, the things underneath are Views. For openGL, Juce creates an Android OpenGLView. You'd have to get hold of this if you wanted to share it with another rendering library. However, this could lead to trouble. Instead, you might want to allow your 3D renderer to create its own OpenGLView and rehost this inside Juce.

also, there this, http://gitorious.org/irrlichtandroid/irrlichtandroid but it looks a bit old.

BTW, be sure to go OGL ES 2.0 and not 1.x, otherwise you've no chance on Android nor iOS.

 

Cheers Hugh, really appreciate the responses.

 

After a few days digging around it looks like it's going to be pretty difficult to get the two working together, especially on different platforms.  I'm sure it's possible, but Irrlicht seems like it's setup so you never have to touch the OpenGL context directly (or give it one to render to) and this heavyweight window stuff seems like a bit of a risky way forward. (this is a commercial project and I have to make the decision today)  Bit of a shame as I'd way rather spend the next few months using Juce (and get this company on the Juce train as well haha).