Advertisement Jump to content
Sign in to follow this  

"WriteConsoleOutput" Flood Screen?

This topic is 4902 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to flood the console screen with solid colors, but I have a problem: it's not flooding correctly, actually, not at all. My code looks correct, but it's not printing how I want it to. I think that it's going off of the console window. Any help? Here's my code:
void FloodScreen(WORD Props)
     bool Done = false;
     int DBHEX = 219;
     CHAR_INFO Flood;
     Flood.Char.AsciiChar = DBHEX;
     Flood.Attributes = Props;
     COORD BufferSize = {80,25};
     COORD CPos = {0,0};
     SMALL_RECT WArea = {0,0,0,0};
     while (!Done)
           WriteConsoleOutput(wHnd, &Flood, BufferSize, CPos, &WArea);
           if (CPos.X >= -80)
                CPos.Y += 1;
                CPos.X = 0;
           CPos.X -= 1;
           if (CPos.Y >= 26)
                Done = true;
(To call this function, I use FloodScreen(FOREGROUND_RED); Also, you must include windows.h, stdio.h, and stdlib.h.)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!