Using LWJGL with SWT canvas

Started by jonkri, October 09, 2008, 02:28:29

Previous topic - Next topic

jonkri

Hello everyone!

I'm using the OGRE 3D engine through ogre4j to draw on a SWT canvas. The possibility to draw on an AWT canvas is not currently available in ogre4j. Anyway, in order for me to use LWJGL I need to wrap my canvas into a LWJGL Display somehow. Is there a way to do this?

Thank you in advance!

Warm regards,
Jon Kristensen

Matzon

swt supports using lwjgl as a backend - there are some snippets on eclipse.org. LWJGL has the possibility to draw into any canvas using the Display.setParent() feature.

jonkri

Thank you for your reply. However, I don't quite understand.

The only snippet I could find was http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet275.java?view=co, and it doesn't use a LWJGL Display. Also, how can I use Display.setParent() on anything other than an AWT canvas when the method is defined as setParent(java.awt.Canvas parent)?