Thread: smoother painting

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    108

    smoother painting

    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

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    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.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    108
    Awesome, thanks a lot

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Painting
    By prongs_386 in forum Windows Programming
    Replies: 12
    Last Post: 05-04-2007, 05:07 AM
  2. mouse messages, painting, tabs
    By ZeroG in forum Windows Programming
    Replies: 0
    Last Post: 06-20-2005, 03:51 AM
  3. Painting with Tex on a Win32 Application
    By webzest in forum C++ Programming
    Replies: 5
    Last Post: 08-16-2004, 03:04 PM
  4. My newest digital painting - work in progress
    By jdinger in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 07-17-2004, 08:22 PM
  5. Question about painting
    By Ariod in forum Windows Programming
    Replies: 10
    Last Post: 08-24-2003, 01:36 PM