Menu

#21 gui updating

open
nobody
None
5
2005-10-26
2005-10-26
kristi
No

each window in the simulation uses a different method of
updating/refreshing themselves.

the JOGL Canvas uses an Animator which regularrly
refreshes it.

the map panels use Swing, and rely on a manual
update() call to be repainted. (And Swing will update the
maps if there is enough CPU time available)

the Graph panels are updated whenever a value is added
to the graphs (whether the graphs are showing or not).
The Graph panels somehow get precedance over the
map panels when they get refreshed. The graph panels
also suck up a significant portion of CPU as the
simulation slows down a LOT when the graphs are
showing.

Investigate what is the best method to update the GUI
with, and clean up the repainting so it gets done well.
(Everything should get refreshed regularly, and no window
should get preferrence over another).

Discussion

  • kristi

    kristi - 2005-11-09

    Logged In: YES
    user_id=795959

    So apparently, we shouldn't be using JOGL's animator.

    http://www.javagaming.org/forums/index.php?topic=10450.0

    I'll try using their FPSAnimator to slow the JOGL
    refreshing... or we can just call GLCanvas.repaint()
    whenever we feel like it.

     
  • kristi

    kristi - 2005-11-09

    Logged In: YES
    user_id=795959

    FPSAnimator seems to be working well. At least CPU isn't
    100% anymore. At 10fps, cpu hovers around 80% for this comp
    (P4, 2.8GHz, 1Gig ram, WinXP pro SP2).

    Set the fps in constants.Options.JOGLFramesPerSecond

     

Log in to post a comment.