Pure Java or LWJGL?

Started by
5 comments, last by axel1994 10 years, 2 months ago

Hello game devs!

I am just wondering if i should continuly learn pure java for my 2d game or i should start learning lwjgl?

P.S:my goal is to make a terraria clone.

Advertisement

LWJGL lets you use OpenGL so if u have not used that before it might be a slight learning curve.

But on the other hand it helps you do alot of things like creating your screen/window and setting your fps.

Javas own libraries should work fine but you will have to do stuff like the fps syncing for example yourself.

Personally i would pick going pure Java but thats my opinnion after trying LWJGL out by making a pong clone.

Haven't used Java for years, I just wonder if it provides enough 2D performance for something Terraria-like out of the box.

As Rakso mentioned, LWJGL is a wrapper for OpenGL, a low level graphics API which is IMO a little bit hard for beginners. For 2D, you might wanna look at Slick2D, which uses LWJGL under the hood.

I was thinking in picking up LWJGL because its has all this methods pre made witch its cool because i dont need to reinvent the wheel but i cant find tutorials except CodingUnivers witch its quit good but he focus more on 3D. So i am wondering if i am using Pure Java for 2d games its good,can i get good performance ? If not i will stick with Love2d :D

I think the only hardware acceleration you can get with Java is by using canvas to draw. If you want to work with Java work with Java. If you want to use OpenGL use LWJGL, JOGL, LibGDX, or some other framework. It depends on what you prefer. I'm not familiar with Love2D but if you're having success with it you shouldn't need to switch.

LWJGL is a good choice. The reason is not OpenGL, which is easy to use JOGL and just set stuff up yourself. The reason is the JInput and OpenAL integration. There is very poor support for keyboard and mouse and none for other controls with straight Java. As for sound, the Java sound support is so terrible that you'll be switching. Rather that learn Java2D, OpenGL, JInput, and OpenAL all by yourself, starting with a wrapper API is a good idea.

Having written straight Java2D games and tutorials about it, I can tell you that learning one of these wrappers is time well spent.

If your goal, however, is to learn how all these things work, and you are not trying to crank out a game, then by all means give them a shot by hand.

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

Didn't see the date

"Talk is cheap. Show me the code."

- Linus Torvalds

This topic is closed to new replies.

Advertisement