AWT/Swing vs OpenGL (Which should I use)

Alright guys, I have a quick question to ask. I currently have a hobbyist project which is going to end up being a multiplayer 2D RPG, the maps are going to be drawn with Tiled, however I’m not worried about the implementation of Tiled with Swing, as my friend has already created(manipulated) a library for with (Ported to swing from libGDX).

My question is, what would be more beneficial to learn? I know that everyone’s main goal is to become a “Game-Designer” however, I understand that the likelihood of making any type of living from designing games is slim. I do however believe in quality > quantity. I want my games to be created efficiently and available on multiple platforms (Thank you Java), I’m not sure if Swing graphics can be ported over into android applications yet (I’ve yet to look it up, nor have I developed and android application yet, however I will surely start developing on them soon).

What do you guys prefer to use? and why?

LWJGL.
It is WAAAAY faster :).

AWT/Swing will never be available with the Android APK, it just isn’t possible with the dependencies it has.

Now, as for your question.

You need to ask yourself what you want to do. Do you need speed and knowledge of how hardware renders data? Or do you want to trade that for slightly less speedy code and almost no knowledge about the hardware, but you get a game out quicker?

Java2D is a high level graphics API that basically takes all of the low level stuff out of your hands and gives you back easy to use code, albeit slower than OpenGL. You won’t be able to do as much, and eventually you will hit a wall, and will need to learn OpenGL, either because you need the extra frames or you need more flexibility.

Now, you can break OpenGL up in two different categories, at least that’s my opinion.

  1. Old GL. Based on old deprecated code, it’s slower, doesn’t have support for custom render (shaders), but is easier to use. Once you learn it, you can create your own utility library very easy so you can make games with almost the same amount of dev time as a Java2D game. Its fairly simple after you get the hang of it, but it’s slow and deprecated.

  2. New GL. Much faster, supports shaders, can create state of the art games. The cons are basically that there aren’t many tutorials out there, but you can take what you learned in old GL and apply it to new GL. Its also way more complex, and you’ll need to understand matrices and lots of math. I recommend at least learning shaders and VBOs someday as tgey are modern OpenGL, and it’s what we’ll be using for a while I assume.

  3. There’s actually a third category, in my opinion. You can mix old OpenGL with new OpenGL and basically create games that with flexible frameworks and rendering, without worrying about matrices and advanced math. I do recommend this way, but eventually you should ease yourself into modern OpenGL and the programmable pipeline.

Just depends on what you need!

From my understanding LibGDX is built ontop of LWJGL.

=============

Without there being many tutorials or methods of learning the New OpenGL methods, what would you recommend? I don’t mind reading and figuring things out, however I prefer it being explained. Instead of how most documentaries do it and give you a stupidly large class file, and say “This does this”.

As I said before, I prefer quality>Quantity. I’m not trying to make something crazily in-depth, however, a basic game would be nice. Just something that I can look back at and say that I completed. For inspirational purposes. The first few steps are always the hardest, at-least in my opinion, but once you’ve got a game running, you can always optimize it, then take the code for that game and create your own framework, which would make creating more games even more simple, as you already have pre-written code that you understand.

I mean seriously, if I could get a player moving around, with an interface system, do you have any idea how happy I would be?

I’ve been developing in Java for a few years now, I’m nowhere near a “professional” or someone of a high-status, but I know my way around, however, I’ve never gotten into the graphics side of things until just recently, and it feels like a whole new language.

Oh, I understand. I’ve yet to complete a game, although I’ve finished a few other projects. I get where you’re coming from!

I would recommend learning display lists first. Seriously, OpenGL is confusing as all hell when you first start, so you don’t want to get too deep into it at first. Display lists are a tiny bit more advanced than immediate mode, and I would probably get yelled at for recommending you just learn straight immediate mode. Display lists offer a slight boost in FPS, but they’re still deprecated.

Go look up theCodingUniverse on youtube, he is honestly the reason I’m here telling you about all this stuff. He explains lots of stuff that has to do with LWJGL in a very precise and informative manner, and I would be surprised if most people here haven’t watched at least one of his videos!

Quality will come in the future, let yourself just learn and ease into it for now. Don’t rush, because you’ll miss valuable information like I did! That’s why it took me so long to learn (~6 months to learn up to OpenGL 2.x).

Edit: Yes, LibGDX is built on top of LWJGL, but I stress that you learn straight LWJGL first, or at least a little, before you jump into engines/libraries. You need to understand the basics of OpenGL, because it doesn’t work like other graphics APIs.

I’d say just jump on libgdx. I spent a few months learning opengl, and it was a pain up the ass (speaking as an entirely self (internet) taught person with no experience in anything but java). I eventually managed to create what I wanted, but I have now switched for good to using libraries such as Libgdx or jpct.

If its a hobby do you really need to learn the details of something like opengl? With libgdx you get great performance and its so quick and easy. I dont see why you need to understand the basics of opengl to use libgdx, and whatever you do need to know is easy to pick up.

You need to know the basics because you can’t wander around through programming not knowing what the underlying code does. What if LibGDX is suddenly dropped and no one updates it anymore and it dies out? Its going to happen eventually, nothing ever lasts. Well then, we’ll need people who can create the next LibGDX.

My motto has always been “Learn what you need to for when the complex stuff breaks”. Something will always go wrong, and being caught without knowledge on OpenGL is just silly; its honestly not that hard to learn, you just need to have time and patience for all the mistakes you’ll make because there will be plenty.

Now, there are two kinds of people in the game programming world. People who just want to make games and people who want to tinker and make a game eventually. I like tinkering, I really don’t care about actually making a game, I would rather make an engine or learn about some low level function. I assume you’re one of the people that likes to just make games, and that’s fine, its just there’s no point in not learning.

Learning never hurt anyone!

Can’t really imagine a situation where there will not be an alternative (slick… now people use…). But totally no harm in it, can only be a benefit learning this stuff. With hindsight however I wouldnt have bothered.

Slick has been abandoned for awhile now, however it is still used.
LibGDX was born from Slick’s decease.

:slight_smile:

http://www.java-gaming.org/topics/should-i-switch-to-lwjgl-for-a-little-bit/30405/msg/280565/view.html#msg280565