SWT and LWJGL...

Hi everybody,
I don’t know if there’s anybody out there interested in the subject but I added some code to LWJGL 0.8 (leaving its API intact I just extended it) to make it work into a SWT Canvas.
If somebody thinks that’s useful code I can comment it a bit more ;D and release it.
I finished the Windows version of it and the Linux one should be completed in a few days, but I won’t be able to implement a Mac one 'cause I ain’t got a Mac :wink:
Bye,

Nifty. I can see that becoming a popular extension.
How does it work?

Cas :slight_smile:

I’d like a sneak peek too.

Well…it works something like this:

  1. I created a org.lwjgl.opengl.GLCanvas (it’s an extension of a SWT Canvas holding the HGLRC and the hDC).
  2. I created a few native methods to create/dispose contexts and to swap buffers and switch context (i.e. to another canvas).

I tried, even in the C++ code, to be as close to LWJGL-style as possible.
Anyway I can comment the C++ and Java code a bit more and send you all the stuff ;D

Go ahead and post! We’re in a middle of a larger restructuring of the GL extension code, but it could make an interesting addition for the next LWJGL version.

  • elias

OK…I’m gonna send you the code tomorrow as soon as I’m able to get a couple of examples finished ;D
I have got a very simple one but I’m trying to realise something using SWT layouts.

Xith3d has a similar SWT integration topic as well.
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=xith3d;action=display;num=1071766569;start=0#3