I Want to Learn LWJGL

Hello, all!

I have a good amount of experience in Java 2D and I like using it to make games. But the documentation for Swing and AWT are not oriented toward game creation, and it is often hard to find the best way to do a simple task like find a good timer, implement a game loop, or use double buffering (or triple buffering). I have Killer Game Programming in Java, and it is an excellent resource, but I am still not satisfied with any official documentation. I don’t really want to learn any other libraries, since I prefer to make my own engines/frameworks/whatever from scratch, but it seems that the best solution for me to have a game-oriented and highly functional base library is to learn LWJGL.

However, I am not interested (for now) in anything 3D. Is LWJGL too complex to learn just for 2D applications? How much work does it take to lay the foundation of a game in LWJGL vs. regular old Java? Should I just stick with the comfortable, familiar, Java 2D?

If making the leap to LWJGL is worth the effort (and at some point it has to be), I believe I would have to learn quite a bit about openGL and low-level rendering in general, but I love to learn stuff like that as long as the information is presented in an accessible and orderly fashion. What are the best resources for me to learn to use it? I prefer books if they exist, but online tutorials can be useful as well.

Thank you!

I’d say it’s worth it. It’s much faster to use OpenGl for either 2D and 3D.
I just started to learn 3D OpenGL using this book: http://fly.cc.fer.hr/~unreal/theredbook/chapter01.html
It’s more about 3D stuff, but the first chapter(s) cope with general OpenGL concepts and techniques, and it’s easy to understand. There’s also a pdf version available. Just google “the redbook”.

For 2D only stuff I have no good resources but I think you have to know something about OpenGL if you want to use Slick.

How to learn?

Opt for private lessons with princec. ;D

If I had the money, I would.

Opt for private lessons with theagentd :wink:

Nooooooo that is a really old book using extremely outdated OpenGL! :o

@OP
Learn OpenGL here: www.arcsynthesis.org/gltut
And the ported Java+LWJGL code: www.bitbucket.org/ra4king/lwjgl-shader-tutorials

However, the above tutorials focuses mostly on 3D, although it is also possible to only use 2D.

I think what’s best is for you to use a library on top of LWJGL, like LibGDX, which specializes in 2D and offers lots of awesome features.

I just finished reading this and I found it pretty good :stuck_out_tongue: I know that it must be outdated but it helped me to understand the basic concepts.
Thanks for the link though! :smiley:

Why don’t you start with the LWJGL wiki?
http://www.lwjgl.com/wiki/index.php?title=Main_Page

It covers very basic topics, but it is easy to understand and provides full source code.

Agreed with Longarmx, I used to learn from there.

I think this is best solution - I used to learn LWJGL from there, too.

I think here is a good place. ;D

I managed to pick up the basics in a week, and created a foundation of a game using this code in about two weeks. I think it’s well worth trying, and not harder than any other drawing API.

In this thread you can follow a bit of the story (from second half of the top posting):
http://www.java-gaming.org/topics/learning-opengl-lwjgl/27785/view.html

Although this is more like 3D, I actually started with 2D OpenGl example which just drew a flat square. And other than the lansdscape all the objects are billboard, so actually 2D, too.