Changeset 5383


Ignore:
Timestamp:
May 30, 2008, 12:59:50 PM (16 years ago)
Author:
jack
Message:

Lock speed to 60fps - prevent things from going out of control on small datasets.

Location:
anuga_work/development/anugavis/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/anugavis/src/events.c

    r5380 r5383  
    9898  if(ticks == 0) lastframe = ticks = SDL_GetTicks();
    9999  else ticks = SDL_GetTicks();
    100   if(ticks - lastframe >= FRAME_INTERVAL){
    101     lastframe = ticks;
    102     if(anugavis.current_frame < (signed int)anugavis.number_of_timesteps - 1){
    103       if(!anugavis.paused) anugavis.current_frame++;
    104     }else
    105       anugavis.paused = 1;
    106   }
     100  if(ticks - lastframe < TARGET_FRAME_RATE) return more;
     101
     102  lastframe = ticks;
     103  if(anugavis.current_frame < (signed int)anugavis.number_of_timesteps - 1){
     104    if(!anugavis.paused) anugavis.current_frame++;
     105  }else
     106    anugavis.paused = 1;
    107107
    108108  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  • anuga_work/development/anugavis/src/events.h

    r5379 r5383  
    22#define EVENTS_H
    33
    4 #define FRAME_INTERVAL 100
     4#define TARGET_FRAME_RATE 60
    55
    66typedef enum {KEY_FORWARD = 0,
Note: See TracChangeset for help on using the changeset viewer.