I have a small radasm project that puts one letter at a time from a string into a edit box. When the text is displaying, I get an annoying flicker in the text box area. It looks like a raster line. I have a 3800 Athlon and a newer Nvidia card that should be able to handle what I am trying to do. Can someone please have a look at my code and possibly suggest a way to smooth out the display.

Posted on 2007-04-26 22:54:14 by SideSwipe
at first, for my hardware (ATI Radeon X1650) everything looks pretty smooth.

The way is to use double buffering, which is some work to do.. You should have a memory device and paint the text without the edit control, e.g. with DrawText which is finally the "essence" of the edit control.

Then you can use BitBlt to transfer the memory device to your main window in result of WM_PAINT handling. To get the animation, just cause InvalidateRect & UpdateWindow to the main window to get the paint message.

And be sure to disable any background color / brushes of the window, otherwise you will have an WM_ERASE before paint, which will flicker a lot too.
Posted on 2007-05-03 03:40:20 by beaster

Thank you for your reply. Most times the display does look fairly smooth, however sometimes the "flicker" is quite noticeable. I will try your suggestion of drawing the text to a memory DC first, then blitting it to the screen. I am also  looking around for some open GL or DirectX examples for double buffering. I want to try and make the text "This software was coded in 100% Win32 Asm for Size and Speed" display without a huge artifact.

Posted on 2007-05-05 10:58:17 by SideSwipe
You don't need to use GL or DirectX for this. I only use it when the interface is heavy, and heavily-custom. The overhead of using DirectX and GL (and fighting their limitations) just isn't worth in a simple GUI. (or actually most GUIs)
Posted on 2007-05-05 17:05:35 by Ultrano