   Console flickering
  I want to make a small console ascii game, and i managed to make my own console using functions from the Win32 Console API, but the console is flickering >.>I keep a buffer of CHAR_INFO which has ConsoleXSize * ConsoleYSize elements, where ConsoleX/YSize are the dimensions of the console buffer.The functions WriteString, GoToXY, SetColor, ClearDisplay, SetSize only change the buffer.I have the function UpdateDisplay, which checks if the console size is the same as the buffer. If the sizes are different, the console window si resized and then i call WriteConsoleOutput to copy the whole buffer to be displayed to the window.void TConsole::UpdateDisplay(void){ COORD C; C.X = (SHORT)(ConsoleXSize); C.Y = (SHORT)(ConsoleYSize); CONSOLE_SCREEN_BUFFER_INFO CC; GetConsoleScreenBufferInfo(ConsoleBuffer,&CC); if ((CC.dwSize.X != C.X) || (CC.dwSize.Y != C.Y))   {SetConsoleScreenBufferSize(ConsoleBuffer,C);   } COORD C1,C2; SMALL_RECT R; C1.X = (SHORT)(ConsoleXSize); C1.Y = (SHORT)(ConsoleYSize); C2.X = 0; C2.Y = 0; R.Left = 0; R.Top = 0; R.Right = (SHORT)(ConsoleXSize - 1); R.Bottom = (SHORT)(ConsoleYSize - 1); WriteConsoleOutput(ConsoleBuffer,ConsoleArray,C1,C2,&R);}In the code, ConsoleBuffer is a handle to a console buffer, and the ConsoleArray is the buffer where i am drawing to.Even if i use WriteConsoleOutput, the window is still flickering. The flickering is not on the whole window, it is on individual lines similar to http://img861.images.../flickering.png .Any idea on how to get rid of it? I tried to use LockWindowUpdate but it doesn't has any effect.   
  First, you don't check for any errors. That would be a good first step in debugging any application.What do you mean by "flicker?" That implies you're seeing something happening over time, but you posted only a single image. I.e., you haven't adequately described the problem.What do you expect the output to look like?Do you know the problem you're seeing is related to the code you posted? Have you ensured you're meeting all the requirements for setting the size using the SetScreenBufferSize function? You don't check anything in the code you posted. Again, you're assuming your code will always work without checking for errors.Another approach to debugging is to revert your code to the last version that worked correctly. If you then add code and see problems, it's likely the problem is in the code you just added.   ;  I'm not going to make suggestions on fixing your currently problem -- it looks like Buckeye has asked some valuable questions and given you a few helpful pointers -- but if you're looking for some information on how to proceed you might be interested in BenRyves' Windows Console Tutorial.   