Injection of JMEContext into Application

Hi there,



since a few days I’m trying to make JME rendering available to SWT components (using org.eclipse.swt.opengl.GLCanvas) and had to do some workarounds to get it work. From my point of view the main problem is that there is no possibility in the application class to inject a custom JMEContext implementation. The only way is to subclass and overwrite. In additon SWT components are a special case because they need their parent components at construction time in contrast to Swing.



Can you imagine to implement a mechanism to inject a context implementation? If desired a could make some suggestions.



Greetings



Noqmar

Hi,



i would like to use JME3 in a SWT application too.

i Have not yet started testing, but was of the opinion to use the SWTAWT bridge via JME3AWT Canvas.

Just an idea.



Would this work ?

Where would the problems be?



Thanks



Nebelritter

Hi,



I will post a download link for my solution with the GLCanvas when I’m done with it (I think this is a more direct way and I suppose this to be faster than a SWT/AWT bridge) . I’m also wrapping the necessary JME libs into eclipse bundles and fragments. Hope to get a suitable result this week. But I’m still unsatified with the described architectural barrier.



Noqmar

Hello again,



for all who are interested - there is another problem pushing the SWT_AWT bridge as the preferred solution:

The SWT KeyListener doesn’t fire keyReleased events if more than one key was pressed (except the modifier keys).

See: 50020 – KeyReleased not working correctly.



This leads to problems with camera/character control and there seem to be no good chances for a fix.

I have tested a simple example a couldn’t notice any performance differences. Seems to be as valuable as the GLCanvas at first sight…



Greetings,

Noqmar

Hi,

Has any one got a brief example of getting jme3 to work with swt in an eclipse rcp app? What I am looking to do is use jme3 to do 3d display in an eclipse rcp app. So not a game as such.

What I am not sure of (one of many things) is can this be done? Or is jme3 not really suited to this? I have seen some screen shots of similar thing using ardor3d, but I feel like jme3 is better documented in general so would be a better engine if it can be used inside an eclipse plugin part.

thanks,

You might be asble ot grab the inputs directly via the lwjgls keyboard methods. Maybee worth a try, not sure tho

@robbb You can use SWT_AWT with a plain JOGL AWT canvas. There are an heavyweight SWT canvas and a NEWT SWT canvas in JOGL 2.0 but I don’t expose them in JMonkeyEngine 3. I don’t want to start a flame war but Ardor3D works very well and is already used in applications and frameworks based on Eclipse RCP including Geocraft (thanks to Renanse himself). Whatever the engine you will chose you will have to implement some plumbing, the effort mainly depends on the native windowing toolkit, not on the engine itself. When using JOGL 2.0, you can simply use a NewtCanvasSWT which is very reliable and allows an excellent integration in Eclipse RCP / SWT applications.

I advise you to contact Wade Walker on the official JogAmp forum, he has tons of nice tutorials about Eclipse RCP + JogAmp, his blog is very helpful:
http://wadeawalker.wordpress.com/category/java-opengl/

1 Like
I advise you to contact Wade Walker on the official JogAmp forum, he has tons of nice tutorials about Eclipse RCP + JogAmp, his blog is very helpful: http://wadeawalker.wordpress.com/category/java-opengl/

Thanks for the info. I will look into it.