News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Console Flickering

Started by redskull, September 16, 2010, 01:37:39 AM

Previous topic - Next topic

redskull

Does anyone have a slick way of removing the flicker in the Win32 console when doing rapid updates?  I know it's just the console, and not performance oriented, but it's still a nagging problem.  I've tried writing directly to it, double buffering using both SetConsoleActiveScreenBuffer and copying directly using WriteConsoleOutputCharacter, both to no avail.  It used to not be so bad when I could go fullscreen in XP, but Viva Vista.  I know it's probably a lost cause, with the console being all wrapped up in CSRSS and all, but figured it would be worth a shot to ask.

-r
Strange women, lying in ponds, distributing swords, is no basis for a system of government

frktons

Quote from: redskull on September 16, 2010, 01:37:39 AM
Does anyone have a slick way of removing the flicker in the Win32 console when doing rapid updates?  I know it's just the console, and not performance oriented, but it's still a nagging problem.  I've tried writing directly to it, double buffering using both SetConsoleActiveScreenBuffer and copying directly using WriteConsoleOutputCharacter, both to no avail.  It used to not be so bad when I could go fullscreen in XP, but Viva Vista.  I know it's probably a lost cause, with the console being all wrapped up in CSRSS and all, but figured it would be worth a shot to ask.

-r

Did you also try to set the cursor off?

Frank
Mind is like a parachute. You know what to do in order to use it :-)

redskull

Quote from: frktons on September 16, 2010, 10:27:23 AM
Did you also try to set the cursor off?

Yes, to no avail; I even implemented a system to rewrite only the 'dirty' parts of the screen, and that only reduces the flicker to those sections being rewritten.  I guess that's just life.  :'(

-r
Strange women, lying in ponds, distributing swords, is no basis for a system of government

daydreamer

what about rewrite it to be a windows app with directx you have full control of things so you can time it so backbuffer writes at waitforvertical sync or maybe even call direct3d api that writes text on screen?


Tedd

It will be down to blanking and then redrawing without waiting for vsync, as always. Presumably they don't expect you to want to update your text so frequently, and when you do it's going to be through printing a multitude of lines, so it's not really important.
All I can suggest is updating only what you need to (done) and reduce the frequency of your updates where possible (do you really need to update more than 10 times a second?)
No snowflake in an avalanche feels responsible.

redskull

It doesn't even really seem dependent on speed though; More often, just single blank and redraw will produce a flicker; that is, 'erasing' the particular area by repainting the old (saved) background via WriteConsoleOutput, and then redrawing it at the new position (with another WriteConsoleOutput from a different buffer).  It's not even like I'm aiming for 30fps of animation, just repositioning a block of characters once.  I guess the best way is to find a dark color scheme that hides it well.

thanks

-r
Strange women, lying in ponds, distributing swords, is no basis for a system of government

Twister

Turn the cursor off and only write on parts of the console you need to write on.

Or you could just edit the video memory of the console directly.

GregL

redskull,

You said you tried double buffering.  I have had success with double buffering and writing the entire screen when any part needed updating.




redskull

Quote from: GTX on September 16, 2010, 09:07:48 PM
Or you could just edit the video memory of the console directly.

How does one go about doing this?
Strange women, lying in ponds, distributing swords, is no basis for a system of government