Skip to main content
added 19 characters in body
Source Link

Is this right?

I believe the fundamentals of the question were correct.

is there a one second window, before the first game loop executes, where SFML is recording user events

I don't think so, no.

setFrameLimit(x) instructs SFML (if needed) to call sf::sleep after each call to window.display(), to ensure that each frame is displayed to the user for the appropriate time1x seconds. Therefore, as window.display() is called in sRender() in the example, which is called after sUserInput(), there is no delay and for the first frame no user input is handled.

I am guessing that whilst the thread handling drawing is sleeping, the rest of the process remains awake, so user input can be captured for the full duration of each frame. If I am wrong please correct.

Is this right?

I believe the fundamentals of the question were correct.

is there a one second window, before the first game loop executes, where SFML is recording user events

I don't think so, no.

setFrameLimit(x) instructs SFML (if needed) to call sf::sleep after each call to window.display(), to ensure that each frame is displayed to the user for the appropriate time. Therefore, as window.display() is called in sRender() in the example, which is called after sUserInput(), there is no delay and for the first frame no user input is handled.

I am guessing that whilst the thread handling drawing is sleeping, the rest of the process remains awake, so user input can be captured for the full duration of each frame. If I am wrong please correct.

Is this right?

I believe the fundamentals of the question were correct.

is there a one second window, before the first game loop executes, where SFML is recording user events

I don't think so, no.

setFrameLimit(x) instructs SFML (if needed) to call sf::sleep after each call to window.display(), to ensure that each frame is displayed to the user for 1x seconds. Therefore, as window.display() is called in sRender() in the example, which is called after sUserInput(), there is no delay and for the first frame no user input is handled.

I am guessing that whilst the thread handling drawing is sleeping, the rest of the process remains awake, so user input can be captured for the full duration of each frame. If I am wrong please correct.

Source Link

Is this right?

I believe the fundamentals of the question were correct.

is there a one second window, before the first game loop executes, where SFML is recording user events

I don't think so, no.

setFrameLimit(x) instructs SFML (if needed) to call sf::sleep after each call to window.display(), to ensure that each frame is displayed to the user for the appropriate time. Therefore, as window.display() is called in sRender() in the example, which is called after sUserInput(), there is no delay and for the first frame no user input is handled.

I am guessing that whilst the thread handling drawing is sleeping, the rest of the process remains awake, so user input can be captured for the full duration of each frame. If I am wrong please correct.