Jump to content
  • Advertisement
Sign in to follow this  
orcfan32

struct COORD, Members

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'm now working with ASCII graphics in color, thanks to Benryves, and I have been writing my own functions to cover all of the console stuff. I decided to make a function called "FloodScreen(WORD Props)". Now, the code says:
void FloodScreen(WORD Props)
{
     bool Done = false;
     CHAR_INFO Flood;
     Flood.Char.AsciiChar = char('DB');
     Flood.Attributes = Props;
     COORD BufferSize = {1,1};
     COORD Position = {0,0};
     SMALL_RECT WArea = {0,0,0,0};
     
     while (!Done)
     {
           WriteConsoleOutput(wHnd, &Flood, BufferSize, Position, &WArea);
           if (Position.x >= 80)
           {
                Position.y += 1;
                Position.x = 0;
           }
           Position.x += 1;
           if (Position.y >= 26)
           {
                Done = true;
           }
     }      
}
But here's the problem: it's telling me that struct COORD has no member such as x or y. Well, I type "Position." and it had a list of three floats: x, y, and z. I need to use these so that I can finish this function, but it says "'struct COORD' has no member named x". Any clues on why? (If you want to see for yourself, include stdlib.h, windows.h, and stdio.h)

Share this post


Link to post
Share on other sites
Advertisement
Come on guys..don't ignore me.. this problem isn't solved yet.. BTW, if I put my mouse over the variable name, it says that it has something to do with Direct3D.

Share this post


Link to post
Share on other sites
Quote:
Come on guys..don't ignore me.. this problem isn't solved yet.. BTW, if I put my mouse over the variable name, it says that it has something to do with Direct3D.

SiCrane already explained:
Quote:
COORD has two members: X and Y. Your intellisense is probably confused.

Note the capitalization.

Share this post


Link to post
Share on other sites
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!