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 ...

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