[No] A little thing that was mentioned 2 years ago

Moderator: GZDoom Developers

A little thing that was mentioned 2 years ago

Postby TheDarkArchon » Sat Apr 23, 2005 11:45 am

I was looking at the general forum when I stumbled on this:

BBG wrote:To be able to set your own FPS cap instead of just having the option of a capped or uncapped FPS with no control over it. Thanks.
User avatar
TheDarkArchon
OUT!
 
Joined: 07 Aug 2004
Location: Some cold place

Postby Graf Zahl » Sat Apr 23, 2005 2:36 pm

Easier said than done. The game still runs with an internal 35 fps and the high frame rate is only achieved by interpolating the movement. The only thing that would make sense is to cap it by vsync rate. That's something I always do anyway because I really don't like the tearing effects of higher frame rates.

But for setting an arbitrary frame rate you have to do some very messy timing to get it all right. You can't just set the game clock and be done.
It really isn't worth the effort.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Postby Chris » Sat Apr 23, 2005 5:12 pm

But for setting an arbitrary frame rate you have to do some very messy timing to get it all right.

Not really:
Code: Select allExpand view
int msec_per_frame = 1000/wanted_frame_rate;
next_msec = current_msec+mesc_per_frame;

gameloop:
   while(current_msec < next_msec)
      ;
   next_msec += msec_per_frame;
   do_frame();

That said though, I agree I don't see much point in an arbitrary cap.
User avatar
Chris
 
Joined: 17 Jul 2003

Postby Graf Zahl » Sat Apr 23, 2005 6:08 pm

Yes, and exactly that doesn't work because the game runs at 35 fps. Only the renderer is called more frequently.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Postby Chris » Sat Apr 23, 2005 6:55 pm

I'd imagine the main loop is split into main logic, interpolated logic, and renderer. Having just the renderer called wouldn't make much sense unless there was some logic to interpolate between the two tics.
User avatar
Chris
 
Joined: 17 Jul 2003


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest