why are people trying to use Java2D to make games?

case and point. that tutorial link makes me sigh big time…

LWJGL is not an image rendering API, it’s a thin OpenGL wrapper.

If you’re a newb, going straight to LWJGL is indeed daft. That’s why LibGDX, Slick, lwjgl-basics, and others exist – these APIs, like Java2D, give us a high-level means of drawing sprites.

This comparison has come up before. Java2D vs LibGDX vs Slick.

LibGDX/Slick2D is easier to use, easier to understand, and easier to work with. It also performs better and includes a wealth of other game-related utilities, as I’ve mentioned before. Why on earth would anybody still choose Java2D?

And where/what is lwjgl-basics? A google search for “lwjgl-basics” just returns links to a site that shows how to use lwjgl.jar, and not some specific thing that should make my life easier. :slight_smile:

Because people have a free will.
If they want to use Java2D, they will. You can’t change that, and if they don’t want to change, there’s no point trying to convince them otherwise (haven’t seen anyone who actually wants to stick with Java2D yet, but just saying ;))

This whole topic is a pointless argument.

Regenuluz - My own minimal LWJGL-based API and tutorials, focusing on the programmable pipeline (e.g. “modern” GL).

The idea is to replace SlickUtil as the go-to LWJGL utility library.

API:

Tutorials:

From what I’ve read in this thread all I think that I’ve learned is that some of these libraries (I think that’s what they’re called) just shorten the amount of code you need to write something and therefore make it easier and faster to do whatever you’re doing. Since I’m still a total noob and haven’t even tried using any of the libraries, could someone explain how they’re so much better from Java2D?
I’m pretty much going on guesswork here but I’m assuming LWJGL, Stick2D and all of the others were written in Java which would mean that you could most likely do everything that they do with Java2D or something like that?

*This post is based on a lot of guessing.

Speed. There is a big difference between Java2d and LWJGL, LWJGL is several times faster than Java2d.

Java2d is using software to do rendering, while LWJGL is using hardware.

It’s pretty much a fact that Java2D is not anywhere near as fast as libGDX / Slick2D / lwjgl-basics or pure lwjgl with deprecated immediate rendering.

Java2D does not really give you sound… You can’t count that, because the API is the biggest crap, from what I’ve heard.

And finally the ammount of code you need to write to get a window you can draw onto is much bigger than for lwjgl … (But I would say lwjgl’s windowing api is not really good OOP (but you all already know what I say :wink: ))

Uh… not really.

Java2D does use software rendering SOMETIMES. Only when it needs to.
When it’s on windows it mostly uses DirectX, and on linux and everywhere else it uses OpenGL.

The problem is that Java2D gives you so much possibilities (for example simply modifying a BufferedImage only by changing values in a pixel [icode]int[][/icode] array) that it’s not possible to do this with “optimized” OpenGL, or simply has to simulate it in software…

*Still posting based on guessing stuff.

I’m still assuming that LWJGL and the others are coded in Java so; If LWJGL and the others are coded in Java and we’re coding programs and that in Java, can’t we just (although it’s probably a waste of time and totally stupid to do it) do everythign that LWJGL and the others do manually using the default Java libraries and stuff?

Another question I have is, why isn’t Java2D being updated to increase speed and that since it’s already been done with non-default libraries and stuff?

LWJGL is just OpenGL binding written for Java, it allows you to use OpenGL functions directly.

Ah, this makes a lot more sense now then. ;D

LWJGL is also a display, sound, mouse, keyboard and controller API. It throws together all the bits you need to make proper games under one library. But it must be said that if you’re thinking of not bothering to learn how OpenGL works then Java is probably the wrong language for you in the first place, no? You’d be wanting to use GameMaker, or Flash, or Unity - not a low level platform like Java.

Cas :slight_smile:

Java2D requires no pop-up dialogs… it just runs as an applet unasked, much like flash. So, if you need that then Java2D is the way to go. And java4k games proof that you don’t always need OpenGL hardware rendering capabilities for simple games, and I reckon not for most games that most of us make here.

But OpenGL is still nice :smiley:

Hrmm… not sure if anyone sensible is really still running applets.

Cas :slight_smile:

In my opinion Java is much better for desktop apps than web ones. :wink:

I have a similar question; how can some people consider Java2D to be ‘pure Java’ and why does ‘pure Java’ make it better?

This is just false, even Java2d must use DirectX or OpenGL for rendering… But it makes rendering really slow somehow.

Why is it important to learn how OpenGL works? I think the result is important, not the knowledge about the techniques under the hood. Once you released your game barely anyone will be interested in the libraries/frameworks you used and nobody will ask you about your OpenGL skills. Of course is it good to know how things work, but is it essential? I don’t think so. And hell, we are programming in Java. A language that does most of the low level stuff like memory management and so on for you. It would be nice to know how OpenGL works, but I don’t have the time, the will or the need to learn it.

Understanding “under the hood” is not for consumers/players, it’s for your own sake. You need that to do something fancy like optimization.