Com Frame

From ioquake3 wiki
Revision as of 01:41, 16 December 2007 by NuclearMonster (talk | contribs) (1 revision(s))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Com_Frame() generates a single frame of gameplay. After stripping away the miscellaneous accounting code, the basic flow of Com_Frame() boils down to:

  • Call {{#ifexist:Com_EventLoop|Com_EventLoop()|Com_EventLoop()}} to collect any input events since the last frame.
    • When not running as a dedicated server, {{#ifexist:Com_EventLoop|Com_EventLoop()|Com_EventLoop()}} may be called repeatedly in a spin-loop so that the frame does not exceed com_maxfps.
    • When running as a dedicated server, server FPS is limited using a different mechanism.
  • Call {{#ifexist:Cbuf_Execute|Cbuf_Execute()|Cbuf_Execute()}} to process any commands that may have come in during {{#ifexist:Com_EventLoop|Com_EventLoop()|Com_EventLoop()}}.
  • Call {{#ifexist:SV_Frame|SV_Frame()|SV_Frame()}} to allow server part to do its processing for this frame.
  • Call {{#ifexist:CL_Frame|CL_Frame()|CL_Frame()}} to allow client part to send commands to the server and update the display based on snapshots received from the server.