Best built-in graphics renderer

I have a game so far that loads a map of 64x64 tiles all across the screen, and you can pan around the map, thats about it. Currently I am using AWT I believe to render my graphics, and only the visible map tiles are rendered(+2 on each side of the screen for smoother scrolling)but it doesn’t seem that that’s going to cut it, at least the way I’m rendering only the map so far. Panning around the map creates space between the tiles and its just all around too laggy.

So, before I get much further I guess I should figure out a better method of drawing. I would really like to use only built-in classes to do so since I want to learn to create my own engine for future use.
If I am correct, that leaves me with either AWT, Swing, or OpenGL. I would prefer OpenGL for the speed and flexibility, but I really hate how messy it makes code(my game is 2D, so maybe its not as bad as 3D).

So what are some of your guys favorites?

Slick is nice from what I have heard. I have used lwjgl and for 2d its not all that messy. Just make textured quads. If you want better performance, you will have to go into vertex-arrays/VBO and if you want even more speed, shaders.

But if all your doing is a small game you will probably not need t 4k fps so textured quads should be ok.

I’d also recommend Slick2D too, its API is very similar to Java2D so really easy to move over and it uses OpenGL underneath.

I just saw the syntax of Slick… im switching now. Lol Thanks.

Just to clarify:
Swing is built on AWT: meaning that Swing uses Graphics2D to draw the buttons, list, labels, drop downs, etc…

AWT/Java2D is a very, very high level and powerful API that is excellent for simple games to experiment with its many tools. Its only drawback is its speed, very slow compared to OpenGL.

OpenGL is a relatively low-level API that allows you to directly access the graphics card! This means that you don’t get methods that draw circles and images and rectangles. Graphics cards only know how to do 2 things: rendering triangles and texturing them and those two things it is damn good at doing. Your code may look messy but that’s because it takes many more lines of code to draw an image to the screen because you first need to upload the image data to a texture, bind the texture, specify the vertices of a quad, and render the quad.

Slick2D eases your life by presenting a Java2D-like API using OpenGL underneath. It handles all that boiler plate code to draw simple images and shapes to make your code neat. However, since it is uses OpenGL immediate mode (part of the old “classic” API that is now all deprecated, you will (and should) learn about this later when you study OpenGL), it is still relatively slower than the full power of OpenGL. And by “relatively slow” I mean at least 50-100x faster than Java2D :slight_smile:

Thanks for that great overview, ra4king. I’ve been lurking in graphic performance threads, and Slick2D is mentioned a lot, but this explains its place in the world nicely. Since the API is very close to Java2D (which I’m using now), I’m likely going to target Slick2D for my next version or project (presuming I have the opportunity to get to a next version/project).

Is a Slick2D project (including its dependencies) easy to deploy to all major platforms (Win,Mac,Linux)? I ask because I’ve seen different platform libraries for OpenGL. To answer my own question, the Slick2D info makes it sound fine – I’m just seeking any expert insight from those who have actually used it.

Slick2D just uses LWJGL, which has native code (dlls for Windows, libXXX.so for Linux, and libXXX.dylib for Mac) that you need to put in the library path.