Comparison between lwgjl and Sun Java 3D API?

Ok, like I said, I am very new at all of this, so sorry for having to ask these questions.

I am just starting, so it’s no big deal to switch to a different api if I need to. People here seem to really like lwjgl, perhaps because the developers hang out here.

But here are my main questions:

  1. How do the two APIs compare as far as which platforms they will run on? My current understanding is this:

Sun -> windows, linux, solaris, various unixes, but not Mac (any version)

lwjgl - Windows 2K or XP, linux (I think), Mac OSX planned but no others planned.

Is this close? Could someone with a clue nail it down for me?

And question 2:

I am mostly interested in web-based stuff at the moment. Does either of these have a clear edge in applets? I mean, I probably won’t be using fullscreen at all…

Thanks in advance,
Kit

Oh, I feel dumb.

Quoting the intro page for lwjgl (http://java-game-lib.sourceforge.net/documents/tutorials/intro.html):

“The implications for security are simple and final: your game can no longer be considered secure … This also means you will not be able to use it in applets …”

So, no applets, eh?

Guess I’ll stick with Java 3D. :slight_smile:

  • Kit of the unnecessary questions.

No harm in asking :slight_smile: Yes, we’re not at all applet focused. We are however committed to making sure it works with Webstart, which is applet-on-steroids.

We might well have a proper look at the security of the LWJGL and see if there are any holes. I have a feeling that we’re actually quite secure even though we expose pointers because our pointers are “opaque” - you still can’t do anything funny from them in Java - but there are GL methods that read data into a pointer, and so you can theoretically corrupt data in a fiendish fashion, and there are plenty GL methods that take a pointer to read data from, which can quite easily crash the VM completely.

Cas :slight_smile:

lwjgl works in pre-win2k as well :-X
(@least it works in win98 ;D)

as for lwjgl being able to send the JVM tits up,
regular java2d code can do that as well :stuck_out_tongue:
(specifically BufferStrategy rendering & fullscreen) >:(

Does LWJGL support Linux now? I thought it was limited to Win32 environs, which is the reason I’m working with Java3D rather than LWJGL.

In fact I remember reading something in the LWJGL docs that said something to the effect of it should be for Win32 first and foremost, but that at some random point off in the future other platforms might be supported. This seems to work against one of the really great advantages to doing games in Java and means if you use Java3D what you write today will run on many platforms.

Sure it does - even cas’ AF runs fine on linux. Who do I have to kill to get rid of that lwjgl-is-for-win32-only-right? :). Seriously, it’s a shame to miss a lot of developers just because they think lwjgl is platformspecific, like coilcore.

  • elias

So remove the line from the website! That might go some way to stopping people believing it’s true. They’re only reading the docs you lot have put out… :stuck_out_tongue: ;D

Criminy, we’ve really got to update those docs now…

I think we should mention Linux on the front page, and MacOSX Coming Soon as well.

Is anyone here capable of doing a Solaris port? Or HP-UX? That’d be the last straw for Sun :slight_smile:

Cas :slight_smile:

Matzon already removed the win32-centric part of the docs. As far as solaris goes, I could probably do it myself. If I had a Solaris capable machine…

  • elias

Anyone uses Solaris or HP-UX for gaming then?

Heres what I know -

A while ago I looked that the LWJGL site on sourceforge and it said explicitly support for Win32.

I followed the link Cas put out for the AlienFlux alpha and found a exe file wrapped in a zip. So no dice, I figured it was because it used LWJGL and therefore no reason to not make a jar.

Yesterday I grabbed the source for the JOSRTS and the raw java compiles, but the ‘test client’ and ‘map editor’ targets fail because they are trying to include a bunch of LWJGL dlls into java.system.library and Linux does know what to do with them. So I look again at the LWJGL site and it still said support for Win32 only.

If LWJGL works under linux that is great - but it looks like the people who are using LWJGL still only do whats needed for Win32 and the site turned away people like me looking to make things work on my OS of choice.

Sorry if I sounded a bit harsh, I didn’t mean to. You have every right to feel that lwjgl is (mostly) win32 for now.

Will be updated in the next release.

Actually cas did make a jar (that runs fine on my redhat 8), but yes, cas builds a special exe file for the convenience of win32 users.

Don’t know JOSRTS, but it seems they’re either outdated or too lazy to update docs/source.

  • elias

Great now that I know this - I dug around a little found the rh8 stuff, and have those two targets in JOSRTS building on my system. Though there is one tiny bug that I had to work around that I will report through sourceforge.

hehe, I don’t visit sourceforge often, so if you can be bothered, please post bug reports to the LWJGL forums here.

  • elias

[quote]hehe, I don’t visit sourceforge often, so if you can be bothered, please post bug reports to the LWJGL forums here.

Also do you guys not use any kind of bug tracking? Just keep it in your heads? That doesn’t seem like it can scale well.

I’m not sure why JGLW exists. It seems to me that one could just code in C++ and that would be that. Some of Java’s benifits get thrown out the window when using JGLW like security and cross-platform w/out compilation.

So what are the compeling reasons for using JGLW? Is it just novelty to be able to use shaders in Java? Also - is there not a performance hit when using the wrappers for OpenGL?

In that link posted above, JGLW states that including the entire jvm for j3d is a problem yet the support for Java applets is minut for JGLW. Doesn’t that defeat the purpose of that statement? I could see this being an issue for applets but normal games I do not; since gamers always have to download the latest DirectX or GL version for the latest games (most of the time, these libraries come on the game cd).

[quote]I’m not sure why JGLW exists. It seems to me that one could just code in C++ and that would be that. Some of Java’s benifits get thrown out the window when using JGLW like security and cross-platform w/out compilation.
[/quote]
It’s “LWJGL”. You’re not entirely accurate here. Security might be thrown out, but you can still use the same java code on all the lwjgl-supported platforms, without recompilation. As I stated, AF runs just fine on my redhat 8, with no modifications. Sure, you can call GLX or WGL specific functions not available on all platforms, but then you asked for it. Consider them to be like ordinary GL extensions.

I don’t really get the C++ argument. What stops me from saying: “Code it in assembler and get it over with”? It’s all about freedom of choice. If some wants to do their game in C++, then fine, but those who like java and it’s features have every right to access the same API as C++.

[quote]So what are the compeling reasons for using JGLW? Is it just novelty to be able to use shaders in Java? Also - is there not a performance hit when using the wrappers for OpenGL?
[/quote]
No it’s not about shaders. Yes, there will be a performance hit.

Some people like Cas wants to distribute his game as a demo on the internet. And to do that, it’s absolutely imperative that the size of the download is minimal. Most users would likely be scared off faced by the extra jre download.

  • elias

BTW, cheap Sun machines can be found at http://www.anysystem.com

bad plug jbanes.

Sorry for getting the name mixed up. Anyways, my argument with “why not just use c++” is that why should someone learn the LWGJL api instead of OpenGL? If LWGJL is just a wrapper to OGL then whats the point? What does Java add to the game programming? If people want to do Java servers and non-3d stuff, then one can easily do that with jni (I belive there are several commercial games out there that do that already). This way, the 3d programmer will have total access to all of OGL’s features (and when new ones come out, they don’t have to wait on LWGJL).

So why should someone learn J3D? So why use J3D instead of OGL/jni java? Is it because J3D is not a wrapper for OGL and provides all of Java’s features?

LWJGL is just a wrapper for OpenGL, OpenAL etc. and that’s exactly the point, LWJGL is an enabling technology, enabling java developers to use OpenGL, OpenAL etc. without first writing their own jni wrapper. Had SUN taken their heads out of their asses, they would have given us a similar official wrapper ages ago.

  • elias