to JET or not to JET...

Favorite AWT replacement? As far as I know there’s only one, LWJGL. Is there any other way to make a Java game without AWT (without doing it completely from the ground up)? What can you do with SWT and gaming?

Sure, you’ve gotta use OpenGL with LWJGL, but it’s actually pretty simple, especially for 2D stuff. Check it out, it’s good stuff.

Depends what you’re talking about when you say “AWT replacement”. As a way of getting graphical stuff to appear without touching AWT, LWJGL is an alternative - but as a way of handling and displaying widgets, it is not.

Don’t underestimate the work required to write a GUI!

Cas’ SPGL is a utility layer on top of LWJGL, and he’s now released the Spaghetti GUI subproject as well. Still very much in development and nowhere near as complete as something like the AWT, but may be worth a look if a GUI is what you need to replace.

It also depends if by AWT you mean Java2D, e.g. java.awt.Graphics. At which point you bring Jogl in aswell. You could also consider normal accelerated Java2D as alternaive to Graphics.

Kev

That’s a bad example. There will be a linux version too. I dont know if they will be released the same day… however I bet 5$ that it will be the way it was with Q3. Take the pack files from you windows version, install the latest (linux) update et voila you have a linux version :slight_smile:

Imo it’s really awesome id did it that way.

[quote]Imo it’s really awesome id did it that way.
[/quote]
Agreed! Linux only has AAA games because Id got the ball rolling - if Id hadn’t shown the way, other companies wouldn’t be making games for Linux. I would even go so far as to say that if Id hadn’t shown the way, other companies wouldn’t even have contemplated making them!

It took a determined man, with a passion for technology, in a position of influence but with enough cash to be able to risk failure, to make that first leap. I think Id still lost money on the deal (as Loki died owing them a lot of cash), but they still seem to feel it was and is the right thing to do.

SDL.

Theres also Gage. LWJGL is a 3d api from what I have seen. Not saying you couldnt throw some quads around with textures to make some 2d.

Pretty much of what you can do with the basic AWT graphics. Theres also a plugin for OpenGL. Haven’t tried it though so I have no idea on quality or completeness.

Final note: dont leave Linux in the dark. Sure, having a Windows port is pretty much required if your looking at selling and making money. But Linux will continue to grow. Check out happypenguin.

www.happypenguin.org

Let me get this straight (because I’m new here). Everyone in the forum who’s doing games seriously they’re using LWJGL?

I mean the reason I picked Java for my last game was because AWT is such a clean API, that lets you do graphics quickly and easily (esp. since v1.4.x). Why go through all the trouble and use all these JNI calls and other shortcuts if you think the AWT isn’t good enough. Just to use garbage collection and avoid pointers?

Maybe it’s a case of me not seeing Java from the depth that some of you might do, but I like like Java because with all its embedded tools/libraries, you don’t have to reinvent the wheel.

I mean if DirectX wasn’t the ugliest API ever, I’m not sure if I would be using Java right now.

Maybe Cas has the answer, as he’s done all this great stuff by now…

Personally I use Java because:

  1. I write Java software professionally, so work with it every day and understand it more than others. (Probably a reason I should use another language in my free time…)

  2. JVM allows for “write once, run anywhere” usually.

  3. Syntactically it’s a lot cleaner (for me at least) than C/C++.

  4. Great choice in Java tools vs. VS for C/C++.

  5. Great community.

  6. Right now there is a lack of gaming software (games, middleware, etc) written in Java, so there’s a lot of potential.

Those are the major ones for me.

Exactly the reasons I use Java for. But I wasn’t looking for such answer. If you remember when Java 1.4 was announced it was promoted as a gaming language (remember the videos?) I am personally using these Java libraries, but from what I understand most of the guys here don’t. The question is if you don’t like the libraries provided by Sun, why sticking with Java anyway?
update I’m only talking about game programming here.

[quote]Personally I use Java because:
[/quote]

[quote]Let me get this straight (because I’m new here). Everyone in the forum who’s doing games seriously they’re using LWJGL?
[/quote]
I’d guess that the two main APIs being used are Java2d and LWJGL. Jogl seems to be picking up support (i’ve switched from LWJGL since i need lots of Swing widgets) as is Joal and JInput.

Java3D seems to have a few people hanging on to it, but i think most will be switching over to Xith3D (which is Jogl based).

Maybe because java is bigger than just Sun (I’m not implying that sun hasn’t made some great stuff too though…)?

1.4 was a great step forward for gaming on “pure Java” (which IMHO was one of the biggest marketing failures ever) and even more so for gaming on java (i.e. ~cross-platform but not “pure” in the stupid “pure java” marketing ploy)

1.5 will be even better, probably a high-res timer (no need longer to use non-standard timers, even though that shouldn’t be a big issue) and even better java2d graphics performance (at least on linux - opengl).

I would say though that you today can write high performance (hi Cas :wink: games on java (1.4.2)! And it will only become easier and better :slight_smile:

We’re working to make LWJGL the best choice for games development despite JOGL, JOAL, and JInput, by virtue of being very, very, focused on the task at hand. Without the baggage of AWT to worry about we are able to do all sorts of things in a wonderfully simple way. The new Sun libraries are an excellent choice for a very full-featured platform; but we’re concentrating on crossplatform games and games alone, and we’ve made a very deliberate decision to make our API super-easy to get onto a console…

Right now all that LWJGL lacks is MacOS support.

The reason I use Java was never because of the standard libraries, it was because of the easy syntax and extreme friendliness of the JVM. Loads of the stuff in the standard libraries makes life incredibly easy for a game developer as it is; serialization, RMI, etc. etc. just make some things which are a huge chore in C++ entirely trivial in Java. The only thing missing was proper game API support: we’ve got that now.

I’m looking forward to generics because they’ll allow me to write more correct code first time and with less typing. Net result: cheaper.

I’m also rather fond of the fact that Java is free :smiley:

Cas :slight_smile:

[quote]I’m also rather fond of the fact that Java is free :smiley:
[/quote]
Well, not the way (JET) you use it :wink:

Thanks :slight_smile:

No.

JNI allows API writers to create java methods that expose native functionality. With a little work API writers can even make these APIs crossplatform. We’ll use LWJGL for example: a bunch of people wrote the API and dealt with the evil pointers and other native nastiness. Now, if you use the API you write pure Java. Surprise!

[quote]Aha. Ehe. Hm.

Because, in truth, I LIKE Swing. It does the job. Perhaps not well, but it does the job.

I’m waiting for the day Sun tells us Swing’s being rewritten on top of OpenGL. Now THAT would be cool.
[/quote]
I have to agree - Swing is a very powerful GUI all the more so because you can use its peers and models to create a user interface that doesn’t look at all like the standard metal feel. I have used JList for example to produce a nice zoomy Mac-style finder. I find that a lot of game guis are very irritating because they’ve only implemented half the widget functionality - scrollbars are a typical bugbear often not responding to scrollwheel or handle drag badly when the list is too long, etc., etc. Swing gives you great building blocks that can save a lot of effort and Java is all about doing the job once, right.

I also wish Swing would work with OpenGL… But then again it should be possible to set up an offscreen graphics context for the Swing components, copy it into the GL buffer every frame and pass back the mouse clicks. Hmmm. Might have to do some experiments!