Lock Frame Rate??

This is a discussion on Lock Frame Rate?? within the Game Programming forums, part of the General Programming Boards category; Ok. i'm programming a game in DirectX and I need to lock my frame rate to 30fps. How do i ...

  1. #1
    Unregistered
    Guest

    Exclamation Lock Frame Rate??

    Ok. i'm programming a game in DirectX and I need to lock my frame rate to 30fps. How do i do this? Please someone give me some code or atleast a good function I can use to get the time with precision.

  2. #2
    Evil Member
    Join Date
    Jan 2002
    Posts
    638
    I don't think that is possible.

    It may be possible to CAP a frame rate of 30 fps, but if the kernel doesn't serve up resources fast enough to maintain 30fps, then you can't make it.

    As for capping, you can probably do that with some efficient language constructs.

    Just take a split in millliseconds when you draw, and when you are ready to draw again, check that at least 33 milliseconds have passed since your last split, and if not, hold the redraw, or anything else you wanna hold up, until that happens

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Frame Rate Limiter
    By Nurfina in forum Game Programming
    Replies: 13
    Last Post: 04-14-2007, 02:29 PM
  2. Animation not working....
    By aquinn in forum C Programming
    Replies: 7
    Last Post: 02-19-2005, 05:37 AM
  3. the effects of textures on my frame rate
    By DavidP in forum Game Programming
    Replies: 37
    Last Post: 10-03-2003, 12:24 PM
  4. Frame Rate
    By Tommaso in forum Game Programming
    Replies: 6
    Last Post: 04-04-2003, 06:40 PM
  5. Whats a good frame rate?
    By compjinx in forum Game Programming
    Replies: 16
    Last Post: 04-07-2002, 06:31 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21