Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By Fubarable

Thread: Optimizing paiontComponent()

  1. #1
    EricB is offline Member
    Join Date
    Nov 2011
    Posts
    3
    Rep Power
    0

    Default Optimizing paiontComponent()

    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 :-)
    Eric B

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default 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!).
    DarrylBurke likes this.

Similar Threads

  1. Still need some optimizing help for my game.
    By Alerhau in forum New To Java
    Replies: 5
    Last Post: 09-25-2011, 08:18 AM
  2. Quick Optimizing question
    By sgthale in forum New To Java
    Replies: 6
    Last Post: 04-15-2011, 01:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •