lwjgl convert to libgdx?

So, I’ve been noobing around trying to learn to use libgdx from tutorials and demos. I have written quite a few games with straight Java 2D, but I’m finding that diving into libgdx is drowning me a bit.

Part of the reason is that there is not a lot of learning material that seems appropriate for where I’m at (to go from Java 2D to libgdx). Here’s what I’m wondering: if I take a different approach and try to learn to use lwjgl instead, which I’m assuming has more beginner-friendly material, will I later be able to convert this to a complete libgdx implementation later?

Thanks in advance for any help.

And I see that there is Slick2D out there, which (I think) is built on lwjgl? Or am I wrong about that…

So if I implemented a game project using slick and/or lwjgl, how well would that port to libgdx?

Sorry for my ignorance, it’s a terrible thing, ignorance…

If you’re wanting to port between Desktop and Android, libgdx is built for you. Just use it direct.

Kev

Thanks for the reply :slight_smile:

While yes, I am wanting to port to android at some point, I’m looking for a good starting place first. It seems to me that an understanding of only Java 2D is insufficient to comprehend libgdx right away.

However, from your reply it sounds like I need to stick with only libgdx, then. Hmmm…

Maybe what I need are some tutorials on openGL first?

If you’re familiar with Java2D, I’d recommend you give Slick2D a go first, its API is remarkably similar and you should have no problems switching over. You’ll only have to learn a few small API differences and you should be good to go. Besides it’s a good first step into the Java/OpenGL arena as it’ll get you familiar to stuff like using natives, allow direct access to OpenGL, etc.

Another thing to keep in mind is Slick2D’s community is slightly larger and more active, so its much easier to get help from ppl and the forums already contain a wealth of knowledge. Also the documentation (especially the Slick Wiki) and code examples are probably the best of any Java games library.

Thirdly Slick2D has a solid toolset already around it e.g. Font Creators, Particle Editors, Map Editors, etc so that’s another advantage that can help you get a game up and running quickly.

Lastly if you later want Android support you can switch over to LibGDX, also you never know by then Slick2D might even have a mature LibGDX wrapper (one already exists) which basically allows you to run Slick2D on top of LibGDX.

Well that certainly sounds promising – maybe I need to spend the evening cramming Slick2D into my limited brain!

…assuming I can get my taxes done first.

Moving from libgdx to LWJGL is going to be even harder, as LWJGL is a lower level API. If you did build some stuff in LWJGL, you would then probably not have much issue with learning libgdx. Moving from Java 2D to Slick makes the most sense for building desktop games, as the APIs are similar, but not a whole lot of it will translate to learning OpenGL. There is Slick-AE, which let’s you run Slick on Android, so that may be an option for a 2D game. You probably won’t be able to extract every last ounce of performance out of Android with Slick-AE, but I would guess it is sufficient for many games, especially if you are just starting out.

What specifically is giving you problems with libgdx? If you stick with the Sprite and SpriteBatch classes, you should not have much trouble drawing images. You don’t need much more for most 2D games.

I hope I’m not being overly defensive, I would never knock Slick as it is great, I’ve built games with it and it is where I started with OpenGL, but to address a few of kappa’s points… The libgdx forums are active and people in the community are releasing games. See the showcase section of the forums and the release of two new games was just mentioned on the blog. Also libgdx has font creators, particle editors, and tiled support. :slight_smile: For documentation we have extensive javadocs (minimal “getName() Gets the name”) and a start of a wiki. More docs are on the roadmap following the 1.0 release.

yup tis cool stuff, LibGDX is indeed shaping up to be pretty awesome.

FWIW, Slick development is slowing down as I get interested in writing games again. Its perfectly useable as is and I’ll carry on doing bug runs for the foreseeable. However, it was built and written very quickly to fill a gap and save me time :slight_smile: Libgdx is early days but it’s shaping up to be awesome, I’d say if you’re just starting and have no vested interest already in Slick2D then it’d probably be more sensible to start with Libgdx.

Kev

Thanks for the great responses, everyone.

Nate: I did not think your reply was at all defensive :slight_smile:
In terms of what is giving me trouble, it’s just hard for me to figure out the basics. I watched all the tutorial videos, and poked around in the demo projects, but this hasn’t gotten me much past learning how to create an eclipse project.

It just seems completely different from how I wrote my straight Java 2D games that I can’t wrap my head around it. I am hoping to find some in-depth tutorials, or a book, etc., but have not found something like that yet for libgdx because it is so new.

Would it make sense to try learning open openGL first, and then try libgdx again? I also see there is a soon-to-be-released book by Mario Zechner, which doesn’t cover libgdx but might still be an option to start with… or would it?

I feel like I am learning to code all over again :-\

We have a documentation effort brewing. There is myself, Mario, and two others. I did one and a half pages tonight:
http://code.google.com/p/libgdx/wiki/ProjectSetup
http://code.google.com/p/libgdx/wiki/SpriteBatch
With just those you should be able to get an app running on desktop and Android and draw some images. Feedback is welcome!

[quote]Would it make sense to try learning open openGL first, and then try libgdx again?
[/quote]
Trying to learn OpenGL == learning LWJGL == answered above.

[quote] I also see there is a soon-to-be-released book by Mario Zechner, which doesn’t cover libgdx but might still be an option to start with… or would it?
[/quote]
Yes, it will solve all your problems, buy it! ;D

Excellent, I will definitely check out the new pages!

Also, I bought the book :slight_smile:

@Nate:
The book has, indeed, solved my problems :slight_smile:

Actually your SpriteBatch wiki page was also helpful.

Sweet. :slight_smile: I’d like to write more soon.