LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: pedr0t on March 31, 2004, 14:04:54

Title: SWT
Post by: pedr0t on March 31, 2004, 14:04:54
I found a few posts mentioning about SWT integration, but couldn't find how to do it. There was a link in one the posts but it was broken, and the CVS tree didn't seem to have anything related to SWT. Could some be kind enough to give me any direction?

thanks :)
Title: Resurrected link...
Post by: fbi on April 01, 2004, 07:10:28
Sorry...but that link is broken 'cause of the fact I did turn my web server off. I did implement a SWT binding on the Windows platform...and I should finally take some to port it on Linux/GTK.
BTW: I restarted the web server so the link you found should work (at leat today)  :D
Anyway we should put it in the CVS someday...Cas can I start implementing the GLCanvas interface and inherit my old SWTCanvas class from it :D  (at least we have a working Windows version soon)?
I think I'll work on a simplified build of the 0.89 version (stripping out OpenAL and something else as long as I can...it should not be a problem to plug it in later).
Title: SWT
Post by: pedr0t on April 01, 2004, 07:18:05
Thanks fbi! :)
Just downloaded the file and it seems great stuff!

I'll try to get GLCanvas in an Eclipse rcp application, let's see what happens :p
Title: SWT
Post by: princec on April 01, 2004, 08:52:33
We've got the new GLContext stuff in CVS now - care to try it out?

Cas :)
Title: SWT
Post by: fbi on April 01, 2004, 11:00:57
Ok...I'm gonna connect to the CVS. I take a look at it and then I tell you what I'm supposed to do  :wink:
Title: SWT
Post by: fbi on April 01, 2004, 11:36:45
OK Cas...I tried the context stuff and all...the question now is: I create anyway a GLCanvas interface, my SWTCanvas class inheriting form it and I care about the registration of the GL context with the new stuff, ain't it?  :)
Title: SWT
Post by: princec on April 01, 2004, 12:18:23
'srite. You just pass it into GLContext.useContext(mySWTcanvas) - and then all LWJGL GL calls will be on your SWT canvas!

Make sure you're in the same thread as the thread that created the SWT context though.

Cas :)
Title: SWT
Post by: fbi on April 01, 2004, 15:01:20
Quote from: "pedr0t"
Thanks fbi! :)
Just downloaded the file and it seems great stuff!

I'll try to get GLCanvas in an Eclipse rcp application, let's see what happens :p


Lemme know about it...  :wink:
I'm gonna try something like this too...so could share same ideas and code someday if you like it  :)
Title: SWT
Post by: fbi on April 01, 2004, 15:02:43
Quote from: "princec"
'srite. You just pass it into GLContext.useContext(mySWTcanvas) - and then all LWJGL GL calls will be on your SWT canvas!

Make sure you're in the same thread as the thread that created the SWT context though.

Cas :)


OK Cas...I'm gonna do that. With this new context stuff my job is even simpler  :wink:
Thank you a lot for this brand new version  :D
Title: SWT
Post by: pedr0t on April 01, 2004, 22:41:55
Quote from: "fbi"

Lemme know about it...  :wink:
I'm gonna try something like this too...so could share same ideas and code someday if you like it  :)


No problem fbi ;)
I'm developing a 3d scene editor (with keyframe animation and the lot) for an academic project. Currently I run it using xith + jogl + swing, but I'm considering moving it to xith + jwjgl + swt. Spend the day abstracting out some of my gui classes, so I could experiment with both environments.

Haven't tried compiled your code yet, but since I've got to finish this before end of hollidays I might stick with my current setup so I don't get distracted with the amount of cool things we can play around with ;p
Title: SWT
Post by: fbi on April 02, 2004, 08:08:39
I understand your situation very well...I'm in academia, too.
Or to be precise I'm trying to get my PhD ended by the end of October  :D
I started to play with LWJGL when I wanted to create a new client for my PhD project (an Embodied Conversational Agent). I used Shout3D for an applet version, then I decided to create a stand-alone application so I resorted to create my own scenegraph API (just to fit my needs you know). But I needed to bind SWT to LWJGL because I wanted a SWT interface...
And so here we are  :wink:
Title: SWT
Post by: pedr0t on April 02, 2004, 12:43:25
[a bit off topic]

Hehe, nice :)  
But in one way is quite cool, because as a consequence you produce something which some one( in this case, the open source community) can actually benefit from. Some times I feel academic projects are really just for grades. I'm not sure how it works for PhD theses, but do they all get published somewhere so people can read? (naive guestion, sorry :p)

My is still an undergrad project (final year :shock:), but I still have to write 15,000 words for a report, which is crazy (given I haven't start it). The problem is that most of the grade seems to come from the report, while the program we write doesn't even count that much (which is quite strange). Maybe I'll have to limit the project and spend more time in the report, and hopefully I'll continue its development after exams.

I'm considering doing master. Fbi, did you start your PhD straight after university?

[\a bit off topic]
Title: SWT
Post by: Matzon on April 03, 2004, 20:25:02
tried to get the binding from http://ant1.di.uniba.it/lwjgl/LWJGL_SWT.zip - no connection ?
Title: SWT
Post by: fbi on April 05, 2004, 07:55:16
Sorry Matzon for the problem...the fact is that I have an Apache web server on my machine that I sometimes turn off when I have to code or develop something  :)
If you try it now it should work fine.
By the way tomorrow morning I will give you the NEW Windows version which supports not only rendering in a SWT Canvas but also the GL context sharing between multiple canvases as requested by some people  :wink:
I started coding the Linux version but as I'm not that cool X programmer   :shock:  I'm getting into a bit of trouble.
Anyway I'm trying just to use X-Windows API as long as I can because, doing so, we could use both the Motif version of SWT and especially the GTK one  :D
Title: SWT
Post by: fbi on April 05, 2004, 09:38:58
Another important question I would like to answer (with the help of the whole community) is about how to produce different versions.
You probably now that SWT is delivered with different jars (and native libraries of course): that basically means that there are a bit of low-level calls which are also possible from the Java side (you must use the OS class) and I actually used because this way code is a bit simpler.
But, of course, these calls vary from Window to Linux to Mac and so on...whatcha gonna do?

1) Put all the context and devices management stuff into C/C++ code.
2) Distribute different versions of LWJGL, that this time differ a bit (in just one file) also in the Java code (that is basically what people do at Eclipse.org).

Lemme know about it so that I eventually accomodate changes ASAP  :wink:
Title: SWT
Post by: Matzon on April 06, 2004, 09:01:01
Well, I like to think that an implementation should be as simple to use and to distribute.
Therefore I think that depending on the complexity, you should do it in native code, or do it using a .win32.GLCanvas | .linux.GLCanvas style class - and then just always distribute them along.

Why do you need to make different versions of GLCanvas? - isn't the management the same?
Title: SWT
Post by: cfmdobbie on April 06, 2004, 10:48:48
Another vote here for not having multiple lwjgl.jars.  How you manage it is up to you! :lol:
Title: SWT
Post by: fbi on April 07, 2004, 13:19:25
Well...the problem is that SWT is distributed as different jars for different platforms  :shock:
Why?!? The reason is that the Eclipse team wanted to access the native methods from the Java side...for example on Windows you can call something like OS.GetDeviceCaps and on Linux you can make similar calls to the OS.
But there's no problem: I will move each and everything into the native code so that we have no distribution problem at all (I will drift away from SWT philosophy indeed)  :D
A small note: I won't be able to connect from tomorrow afternoon to the next Tuesdayso because I won't be at home.
I will work on the Windows and Linux versions following these guidelines.
One Java class and multiple native implementations (of course) for Win32 and X-Windows.
When I get back on Wednesday I'll post the produced code.
If everything runs fine we can integrate it or...we'll need to modify something  :D
Title: SWT
Post by: elias on April 09, 2004, 05:18:13
Hmmm, moving everything into native code doesn't sound like progress to me. Why not merge the win32, X and macosx jars into one and be done with it?

 - elias
Title: The down load for SWT
Post by: jjones7947 on May 16, 2005, 21:05:00
Any chance of getting the web server turned on again? Or is it move to a new site?
Jim
Title: SWT
Post by: rgrzywinski on May 25, 2005, 11:29:57
If you are in need of an SWT OpenGL binding, mine is available at:

http://www.realityinteractive.com/software/oss/index.html#SWTOGL
Title: SWT
Post by: sir_wojciech on June 29, 2005, 13:57:14
So where can one get a SWT Canvas class?
Title: SWT
Post by: Matzon on June 29, 2005, 15:59:31
check SharedContextTest for how to render to a canvas
Title: SWT
Post by: sir_wojciech on June 29, 2005, 17:20:59
where is it?
Title: SWT
Post by: Matzon on June 29, 2005, 18:15:21
http://www.realityinteractive.com/software/oss/index.html#SWTOGL <--------------
Title: SWT
Post by: sir_wojciech on June 29, 2005, 20:19:39
it's a bit old
Title: SWT
Post by: Matzon on June 29, 2005, 20:59:18
just nuke the lwjgl jar and dll and use the latest - works fine @ my end.
Title: SWT
Post by: rgrzywinski on July 01, 2005, 12:00:56
Old doesn't imply out of date.  It simply means that it does what it needs to do regardless of the LWJGL version.  It's a testament to the great work that these guys are doing over here at LWJGL central.

If you have any questions or problems with it, email me directly.
Title: SWT
Post by: sir_wojciech on July 01, 2005, 21:33:00
ok