Results 1 to 2 of 2
- 11-05-2011, 07:24 PM #1Member
- Join Date
- Nov 2011
- Rep Power
I've read that good performance in games requires well optimized paint routines?
Can anyone give guidelines to write well optimized paintComponent() methods?
* Do I have to draw everything every time I repaint() ?
* Should I always do the graphics in paintComponent when doing game graphics?
Any idea or thoughts about optimizing my graphics is appreciated :-)
Re: Optimizing paiontComponent()
I would do any background graphics in a BufferedImage and then draw that first thing in the paintComponent method right after calling the super method. If I required mission-critical super fast graphics, I'd consider not using Swing but rather a dedicated game engine, perhaps one integrated with OpenGL (no pro at this mind you!).