LWJGL , Eclipse and SWT

I was wondering if anyone have any experience
programming on the Eclipse SWT OpenGL package.

And what are the advantages and disadvantes
of the plugin VS LWJGL.

More specifically. I have started development
under the SWT package. And seem to have a
serious performance issues.

As far as I can tell, I seem to be getting great
performance on a Win2K machine and really
bad performance on Win98 and WinXP.

I’m considering a migrate to LWJGL ,
If I can get consistant performance out of it.

I would be even better if I can use LWJGL
with the SWT/Jface Gui stuff.
That way I can take advantage of the
native OS gui calls aswell as OpenGL.

Has anybody have success running LWJGL in an SWT
gui?

Any gneral input would also be great!
thanks

If you can wait about a week or two you may find a surprise in JOGL. :wink:

I have used my own SWT OpenGL bindings (as the SWT OpenGL from Eclipse is quite limited) and I can obtain identical performance as with LWJGL.

The performance differences that you are seeing are quite odd. The dependence of OpenGL on SWT is basically nil. There is basically no difference between the SWT OpenGL native impl and that of LWJGL. Perhaps if you posted some code or had some direct questions then I would be more than happy to look into it. We can do this offline if you perfer.

As for advantages / disadvantages it completely depends on your usage. If you are trying to make a game then you’re probably better off using LWJGL. If you’re attempting to integrate UI and OpenGL then SWT with OpenGL will be a better bet.

I should also point out that jinput works just fine (well, after all of the bugs that I’ve submitted get integrated) with SWT and OpenGL.

[quote]If you can wait about a week or two you may find a surprise in JOGL. :wink:
[/quote]
Is JOGL related in any way to LWJGL?

Other than both being OpenGL bindings for Java, no LWJGL and JOGL differ considerably.

http://jogl.dev.java.net/

[quote]If you can wait about a week or two you may find a surprise in JOGL. :wink:

I have used my own SWT OpenGL bindings (as the SWT OpenGL from Eclipse is quite limited) and I can obtain identical performance as with LWJGL.
[/quote]
Thanks for the reply. I don’t quite understand what
you mean by your own SWT OpenGL Binding. Did
you write your own? :o :o :o

Can you point me to a good direction for a good
SWT OpenGL binding?

[quote]Other than both being OpenGL bindings for Java, no LWJGL and JOGL differ considerably.

http://jogl.dev.java.net/
[/quote]
I tired to get JOGL… But found the installation
aswell the code rather complicated…
Is there a simple tutorial for this ???

[quote] Is JOGL related in any way to LWJGL?
[/quote]

[quote]Other than both being OpenGL bindings for Java, no LWJGL and JOGL differ considerably.
[/quote]
if you compare JOGL to LWJGL there is a huge difference, in the fact that LWJGL is much more (audio, input, math).

It would be more fair to compare JOGL/JOAL/JInput with LWJGL. And here the main difference lies in that LWJGL is meant for games, while JOGL et al. are meant for general purpose applications. Oh, and since it is supported by sun, it will probably become “pure java” while LWJGL won’t (sigh)

[quote]Oh, and since it is supported by sun, it will probably become “pure java” while LWJGL won’t (sigh)
[/quote]
…yeah, whatever that’s worth as far as LWJGL’s goals are concerned :slight_smile:

[quote]I was wondering if anyone have any experience
programming on the Eclipse SWT OpenGL package.
[/quote]
I used it and it worked quite well for me. I ported the first ten NeHe tutorials which are available here -> http://www.3plus4software.de/news/20030407.html (it’s a German text but you’ll probably find the link).

From my point of view, the main difference is that SWT/OpenGL embedds itself into an SWT Canvas while the LWJGL uses an exclusive full screen mode. There are also no classes to use joystick etc.

[quote]More specifically. I have started development
under the SWT package. And seem to have a
serious performance issues.

As far as I can tell, I seem to be getting great
performance on a Win2K machine and really
bad performance on Win98 and WinXP.
[/quote]
I never tried Win98 but the nehe stuff works equally well on both W2K and XP for me.

[quote]I would be even better if I can use LWJGL
with the SWT/Jface Gui stuff.
[/quote]
I think, that isn’t possible out of the box. I once tried to use the LWJGL to change the display mode on Windows and then to continue using SWT on that new mode but it didn’t work that well. At least on Windows, an integration shouldn’t be that difficult because both librarys ultimately use a HWND to communicate with Windows and from the SWT sources, it should be possible to pick up another HWND.

 ...yeah, whatever that's worth as far as LWJGL's goals are concerned

True, but when you market two similar technologies, some will bite on the fact that LWJGL is “impure”

I just hate the fact that so many things are called “pure” java. The only thing that can be pure java is that which does not rely on any native code at all (excluding VM calls).

[quote]True, but when you market two similar technologies, some will bite on the fact that LWJGL is “impure”
[/quote]
I wouldn’t worry about people bashing LWJGL for being unpure cos they’re not your target anyway.
High performance GL games programming and ‘pure java’ just don’t mix. At least not yet.

The java.net technologies are meant for games. And, I’m not sure what is meant by “pure”? We removed public pointer access, but that is it. If there is a case where lwjgl outperformes one of the technologies on java.net, then we should fix it. So, I guess the question is what do you mean by pure Java, and why is that bad?

Doug.

I don’t want to put words in Matzon’s mouth :smiley: but I guess he thinks about stuff like for example logging - compare the new java logging framework versus the opensource alternatives -
one is marketed (or maybe more accurately (?), often referred to) as “pure java” whereas the other choice’s are being marked as “nonstandard”.

I.e. it’s just a marketing issue, it has nothing to do with which one is better or not - it’s just that some people™ :wink: find api’s supported by sun better than others (and I’m not saying that they are not - just pointing out the issue).

I hope that lwjgl and jogl/joal/jinput will friendly compete (as both projects have free access to the code it’s easy to help each other with bug fixes etc) with each other and thus evolve faster and become better :slight_smile:

[quote]The java.net technologies are meant for games. And, I’m not sure what is meant by “pure”?
[/quote]
I just noticed that 100% pure java program has actually been closed (http://java.sun.com/100percent/) … but still:

[quote]Q: First off, what does it mean for a program to be 100% Pure Java?

A: Basically, a pure Java program is one that relies only on the documented and specified Java platform. That means no native methods, no external dependencies aside from the Java Core APIs, and some other requirements that are detailed in the developer’s Certification Steps on our Web site. The certification process verifies that the code is in fact 100% Pure Java.
[/quote]

[quote]So, I guess the question is what do you mean by pure Java, and why is that bad?
[/quote]
(This has become a bit irrelevant since Sun has discontinued the program)
Pure java is not bad per se, the problem is that our technology is just as good as yours (theoretically ;)). However since jogl et al. is sponsored by Sun, they can include it in the J2SE distribution and call it “pure” java. Even though they’re theoretically do the same thing, in the same way. The only way for LWJGL to do this, is to participate in the now closed program, but since we have no money to spare on that account… sort of like the JBoss situation.

[quote]If there is a case where lwjgl outperformes one of the technologies on java.net, then we should fix it.
[/quote]
I never mentioned performance, and won’t untill I’ve actually done some tests :slight_smile:
But the size of the binaries is a bit scary…

JOGL et al are indeed for games but they’re also heavyweight libraries and none too simple to build at that. LWJGL is aiming to provide a tiny library suitable for a minimal J2ME style VM which is little more than a bytecode engine. I rather hope someone comes up with one, too. We’re looking at a bigger and slightly different picture to the J2SE market. It’s still worth pointing out that I still couldn’t even use JOGL even if I wanted to because of the size of the baggage.

We are also aiming to provide integrated capability, and prebuilt binaries. It’s just got to be fantastically easy. Like Allegro, or SDL.

We are, basically, just a different approach to these new J2SE initiatives, but both approaches are completely valid - they’re just aimed at different platforms and usage.

Cas :slight_smile:

As a status update: I have been working with the Jogl guys to get my SWT integration into Jogl. It’s slow going but that is to be expected as they have a lot on their plate and a lot of inputs coming in.

In the meanwhile I may put something up so that those longing for SWT support will have it. Of course this will be with the caveat that the API may change significantly as the integration with Jogl moves forward. If I’m feeling particularly saucy this weekend I will try to get it up on the Reality Interactive site (I will post a link here).