Posts: 2
Joined: 2008.02
Post: #1
This post is just a plug for LWJGL (Lightweight Java Game Library). I notice that nearly everyone in the Mac community is still pretty intent on thrashing it out with C++ and all its attendant hassles, and I wondered if it's because hardly any of you outside the Java community actually know about LWJGL!

So I'd just like to introduce you to the concept of LWJGL with a quick rundown of its features:
  • Wraps OpenGL versions 1.1, 1.2, 1.3, 1.4, 1.5 and 2.0
  • Full support for every relevant OpenGL extension
  • Wraps OpenAL 1.1 (with Ogg Vorbis extension)
  • Optional package: Wraps FMOD (we all know what this does)
  • Optional package: Wraps DevIL (fast image I/O)
  • Abstracts keyboard, mouse, and display handling
  • And there's a utility package with a few odds and sods like matrix and vector classes in there etc.

LWJGL takes care of all the crap setting up displays and handling input and so forth for you and abstracts it away in the most trivial, simple set of classes you could possibly hope for. It's like Blitz Basic for Java. No more hair-pulling, no more learning odd stuff. Just code your game!

Java takes care of all the other stuff that goes wrong with C++ like mysterious crashes and, er, more mysterious crashes. It takes a little while to get used to it but everyone that eventually groks it has a hard time defending C++ for game dev afterwards.

You probably know about Ultratron by now which is written in plain ol' Java with LWJGL; you may not know about the daft but fun RTS Tribal Trouble which is also plain ol' Java and LWJGL.

For an IDE I recommend Eclipse or NetBeans or IntelliJ IDEA. The first two are free; IDEA is probably the best one though, especially if you've come from a C++ IDE.

And at the end of it all you've got your game... and by God, it runs on Windows and Linux too! Bloody hell. There are of course lots of little details to think about but the vast majority are taken care of automatically by Java or LWJGL in the first place.

One last little curiosity: I don't own a Mac, and in fact, I've never even seen Ultratron running on one! One day I hope to be able to scratch together enough money to buy a second hand Mac Mini so I can actually do some testing, but the indie games biz is not quite what it once was so that won't be any time soon Wink

Cas Smile
Quote this message in a reply
Posts: 168
Joined: 2004.10
Post: #2
Why I don't like lwjgl:

1. It won't compile for me.
2. It won't compile for me.
3. It won't compile for me.
4. It doesn't like me.
5. It doesn't seem to like macs.

The mac doesn't have a standard VM made by sun, instead it is made by apple themselves. Although being incredibly faster compared to the windows version, a lot of applets and applications don't like working on the mac. Many a time I found that a program made in java and compiled on one version of jaguar wouldn't work on another (version of jaguar).

Since then things have changed, so I'll check it out again...
Quote this message in a reply
Posts: 2
Joined: 2008.02
Post: #3
Hey socksy old chap, there's FUD in that there post... the VM, though made by Apple, is actually the result of considerable cross-pollination with Sun. They are in fact roughly the same speed more or less although this isn't really too relevant as all the bottlenecks these days are at your video card.

The stuff on the Mac that doesn't work is simply very poorly coded stuff. We have the same problem here in Windows land - almost 90% of applets I try to run don't work at all on my XP machine, and I've got the very latest 1.5.0_03 JVM. All down to bad coding and sometimes bugs in the JDK libs. The LWJGL solves many of these issues by replacing all the crappy stuff with stuff that's much, much, much more reliable.

You won't need to compile LWJGL as we provide the binaries of the releases but there should now be an Ant build which should work perfectly on the Mac and compile binaries direct from CVS.

Cas Smile
Quote this message in a reply
Posts: 749
Joined: 2003.01
Post: #4
I never tried it, but it sounds very friendly and useful, and it's open source, so thanks for such a library!

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Post Reply