[Solved] PaintGL() call understanding [closed]


If you haven’t enabled vsync, frames swap as often as possible (if you haven’t added artificial pause). If you pushed high load on graphics card, it is likely that your program is GPU-limited (CPU have nothing to do and standing idle waiting for GPU to finish drawing).

When your program is invisible, drawing costs close to nothing because noone sees results anyway (optimisation performed by graphics driver internally).

So, answer to your question is – enable vsync. It will lock buffer swapping interval to monitor’s refresh rate, so your frame rate will never rise higher than refresh rate (in fact, it will be locked to numbers 60/30/20/etc., if your monitor is at 60 Hz). This is very useful technique that e.g. eliminates screen tearing.

6

solved PaintGL() call understanding [closed]