Frametime

From Valve Developer Community
Revision as of 02:15, 22 July 2006 by Dutchmega (talk | contribs)
Jump to navigation Jump to search

gpGlobals->frametime

Time spent on last server or client frame. This is ideal for calculating progress per frame but is unknown how many frames it should take.

Example

Alpha should reach 255 in 1 second.

int alpha = 0;

void Think()
{
alpha += 255 * gpGlobals->frametime;
}