2D Graphics Libraries

I know this has been discussed before and I have done quite a bit of searching on the topic, but I have yet to find a complete answer. I have a few questions regarding 2D graphics for games. To begin with, I’m always worried about choosing libraries and methods for coding, because I’m always trying to maintain the widest scope of compatibility that I possibly can. Therefore, a good solution for me means something that is compatible with a wide range of devices, but also something that is fast and efficient in order to support older or less powerful systems.

So, I have a few questions regarding 2D graphics for games.

  1. Besides using VolatileImage, is there any way to make Java 2D more efficient in general?
  2. Are Java 2D and Open GL the only two options? It seems like most of the other 2D libraries are implementations of those.
  3. What are the pros and cons to each option?

As always, your help is greatly appreciated! :slight_smile:

LibGDX is perfect.

I have heard great things about libGDX. I have been hesitant to use it because it sounds like it’s designed to be an entire game programming framework, rather than just a 2D graphics library.

LibGDX can be used just for its 2D graphics APIs, you don’t have to be constrained to its framework.

You should also check out Processing. It has a richer feature set for 2D graphics than libGDX (at least the last time I checked), and supports both Java2D and OpenGL rendering. It can also convert code for JavaScript use. And, it now supports the option you missed out in your original question, which is JavaFX.

Most of the time I just use LibGDX for games and JavaFX for applications.