Refresh rate and Game loop

Hello.

I would like some help to understand how the drawing on the screen work.

So, let’s say I have a monitor with a constant refresh rate of 60 Hz. I also have a GameLoop that execute 70 times per seconde. So my GameLoop will generate 70 picture per secondes to be display on the screen but my monitor can only display 60. So how my monitor will chose what picture do display. Will there be some sort of queue where my picture will be store waiting to be display?

There is no queue for the monitor, it just displays what is available from video memory.
If you were to update your GameLoop 120 times a second and view it with a monitor that had a refresh rate of 60Hz, you just wouldn’t see every other frame.
Essentially, anything faster than the monitor refresh rate is just lost or skipped. It still happens, you just don’t get to see it.

Ok thx

So, I guess that if my GameLoop is slower than my refresh rate I will sometime display the same image 2 times.

Also, the reason why we try to have a GameLoop that is nearly at the same speed than the refresh rate is just to get better performance while keeping the best rendering result right? Faster would just be a waste of CPU and slower degrade the graphic.

Is it the reason why, repaint seems to synchronize itself with the speed of the refresh rate?