SWT

Started by pedr0t, March 31, 2004, 14:04:54

Previous topic - Next topic

pedr0t

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 :)

fbi

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).

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

princec

We've got the new GLContext stuff in CVS now - care to try it out?

Cas :)

fbi

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:

fbi

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?  :)

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 :)

fbi

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  :)

fbi

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

pedr0t

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

fbi

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:

pedr0t

[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]

Matzon

tried to get the binding from http://ant1.di.uniba.it/lwjgl/LWJGL_SWT.zip - no connection ?

fbi

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

fbi

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: