Hello Guest

Using LWJGL with SWT canvas

  • 2 Replies
  • 11012 Views
Using LWJGL with SWT canvas
« on: October 09, 2008, 02:28:29 »
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

*

Offline Matzon

  • *****
  • 2242
Re: Using LWJGL with SWT canvas
« Reply #1 on: October 09, 2008, 05:55:16 »
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.

Re: Using LWJGL with SWT canvas
« Reply #2 on: October 09, 2008, 16:21:27 »
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)?