jME in SWT ViewPart (Eclipse RCP 3.2)

Hi everyone,



I'm trying to integrate jME with the Eclipse RCP framework, using the new SWT/OpenGL Canvas object.

I tried creating a HeadlessWindow using a DisplaySystem, something like this :



display = DisplaySystem.getDisplaySystem("LWJGL");
display.createHeadlessWindow(1024, 768, 32);
canvas.setCurrent();
try {
   GLContext.useContext(canvas);
} catch(LWJGLException e) { e.printStackTrace(); }

display.getRenderer().clearBuffers();
display.getRenderer().draw(new Hexagon("hex", 10));
display.getRenderer().displayBackBuffer();



(This is how the org.eclipse.swt.opengl.Canvas is supposed to be used, it works perfectly with LWJGL)
The problem is that nothing is rendered in the canvas (not even the default black background)

Has anyone tried this before ?
Thanks !

MonkeyWorld3D uses SWT, but they use the older realityinteractive bindings.

Thanks :slight_smile:



Any plans on using the new ones ?

You'd have to ask the MonkeyWorld people, but my guess would be yes.

I finally made it work by writing my own implementation of DisplaySystem.

I'm also going to write a new implementation of BaseHeadlessApp for Eclipse RCP, so that jME may easily be used in an RCP ViewPart.



If anyone is interested, I'll submit it here.

That sounds great, please feel free to post that code here.

Here's a link to the user code forum:



http://www.jmonkeyengine.com/jmeforum/index.php?board=15.0



I'd love to see this code :slight_smile:

Here you are :slight_smile: (DisplaySystem implementation only, for the time being)



http://www.jmonkeyengine.com/jmeforum/index.php?topic=3569.0