Use gvimevery day, and love it as well. The only thing I can't stand is the 
flicker.

Recently, I am reading the source code of gvim.exe, and realize that the 
flicker could be eliminated by introducing a double-buffer + dirty-rectangle 
mechanism:

1. s_dc is initialized by GetDC(s_textArea), change it to an off-screen hdc 
(the memory buffer). and create another HDC named s_dc_real just like the old 
s_dc. So every drawing stuff will be redirected to the off-screen HDC (clear, 
mch_draw_string) without changing the code in many places.

2. divide the screen (text area) into grids, each cell contains 32x16 
characters. They will be marked as "dirty" if updating happens inside the cell 
boundary.

3. At the end of _WndProc, flush the dirty cells to the s_dc_real by BitBlt.

4. Make an option in "guioptions" to enable these "dirty-rectangle".

I suppose drawing can only be triggered after a win32 event: WM_TIMER / 
WM_KEY_PRESS, the right place to flush dirty rectangles is the end of _WndProc.

Am I right ? 
What do you think if you are familiar with gui_win32 ?



-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui