Results 1 to 2 of 2

Thread: Timing

  1. #1

    Timing

    I wish to make it so that, within reason, no matter what the speed of the computer and no matter what the framerate is I can keep my program running at a constant, predictable rate. Did that make sense to anybody? Say that I wish to move forward 0.2 units in a second. I think that I shouls do the following: 0.2/FPS. FPS being the framerate in frames per second. And then I use the answer to that as the amount to move. Do this each cycle through the loop. Am I on the right track?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Vancouver BC Canada
    Posts
    417

    Re: Timing

    I think you would be better of using real time (ie milliseconds, or something) instead of a FPS based calculation.

    Code :
    void move_obects(void)
    {
      - how long ago (in milliseconds, or whatever) did we last move?
      - move objects (speed * time) units
    }

Similar Threads

  1. Timing?
    By detzel in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-24-2002, 05:43 PM
  2. Timing
    By Laz in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 02-06-2002, 07:02 AM
  3. Incorrect timing
    By dew in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-13-2001, 10:58 AM
  4. Animation timing
    By TB-Rex in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 10-31-2000, 12:58 AM
  5. Timing
    By tcs in forum OpenGL: Advanced Coding
    Replies: 8
    Last Post: 02-20-2000, 07:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean