Jump to content
  • Advertisement
Sign in to follow this  
orcfan32

"WriteConsoleOutput" Flood Screen?

This topic is 4834 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!