The game loop does something like this:
| while(running)
{
GetInput();
RunGameLogic();
DrawFrame();
}
|
Any input collected by the OS after the GetInput() call would not be processed until the current frame is displaying and the next frame begins to process.
| A GetInput
RunGameLogic
DrawFrameA
B GetInput
RunGameLogic
DrawFrameB
C GetInput
RunGameLogic
DrawFrameC
|
Any key pressed between A and B will get drawn on Frame B.
Any key pressed between B and C will get drawn on Frame C.
If you pressed a button right after A, it would take almost 2 frames of lag before being displayed.
If you pressed a button right before B it would be slightly less than 1 frame of lag before it was displayed.