How slow is drawing things on a Graphics2D object?

Whenever my game goes fullscreen the framerate drops to 30 from 60. I’m barely drawing anything. This really shouldn’t be happening, it’s just a very simple 2D game. Is this just a fault of the system I’m using? Is there anyway to make it faster? I can provide any specific information you might need

Thanks

False. It can be fast, but you have to write fast code, and know how J2D behaves. Here is but one piece of evidence: http://www.java-gaming.org/topics/renoria-java-mmorpg/30991/view.html
A few posts down he’s throwing around some impressive numbers there. There’s a few other examples around, find them if your interest is piqued.

However it is usually much easier to simply use a direct OGL solution than to wrestle the performance out of J2D, which requires a good bit of experience.

I really highly advise against wasting your time with Java2D. You are better off spending your time learning how to make games than battling with a basically abandoned and slow API.

Java2D is not abandoned - I think you’re confusing it with Swing - it’s just not game-specific so there are lots of things you do in games that are awkward or difficult or slow in Java2D and it’s a pain figuring out what.

The advice is sound though: if you are able to, switch to a game-specific rendering API if you’re making games, such as LWJGL or JogAmp (low-level) or libgdx (higher level 2D) or JMonkeyEngine (higher level 3D).

Cas :slight_smile:

Are Oracle devs still working on and improving Java2D?! I thought AWT in general was mostly abandoned in favor of JavaFX.