Is there any way to make painting be done quickly? I saw an example program from the winprog.org theForger tutorial (font_one), and the way they repaint is not too smooth. As in, when you resize the window, you can see the text kind-of blink, as it is repainted.
And when I resize this browser window (firefox), the same thing don't happen. Everything is repainted so smoothly.
How did they (firefox) do it? Is there a secret method to wait for screen vertical blank, or make painting faster etc?
this is teh tutorial : http://www.winprog.org/tutorial/fonts.html
thanks in advance
Use double-buffering. This is essentially rendering everything to an offscreen bitmap and then using BitBlt to transfer it in one go to your window's client area. It's actually slower because of the extra steps involved but looks smoother ie. less flicker because rendering to the screen is done in a single operation.
This thread should give you some idea on how to implement double buffering; search the board to find more discussions/examples.