Hey there! Glad to have found this forum.
I’m working on a tile and turn-based game similar to UFO/XCOM, jagged alliance and the sort. It is currently completely unoptimized and the interface is setup as a JLayeredPane with the scene at the default layer, and GUI panels in the palette one. The scene is a JPanel with an overriden paint method.
The graphics is “asleep” while waiting for the player or computer triggers an event, like “A fire weapon at B” in which a thread is triggered asking for repeated repaints.
I’m using alpha-channeled images for per-tile light and shadows, and some simple draw routines like lines.
My current issue is that repainting the scene automatically repaints the GUI on top, which is not “necessary” in the game atleast. This is cutting performance atleast in half.
Now, my question is, which would you suggest be the easiest and most effective way to optimize? I’ve looked at bufferstrategy and jogl and what not, but I’m not sure which would benefit me most, and what would be overkill. I can’t seem to get the JOGL demos to work, so I’m not sure how a JOGL enabled frame would interact with JComponents lying on top of it.
Would I be able to use a bufferstrategy directly on the JFrame for the scene, and still have JPanels on top, not beeing redrawn when the scene is, or do I have to render the GUI components offscreen and simple blit the result at repaint?
Please excuse any obvious conceptual missunderstandings I might have, it seems I’ve confused myself looking at differents sollutions already.