Jump to content
  • Advertisement
Sign in to follow this  
arithma

Console

This topic is 4817 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

Advertisement
1. print enough '\n' to scroll the text off the screen

2. system ( "cls" ); //(windows)
system ( "clear" ); //(linux)

3. (windows only)

void clrscr()
{
COORD coordScreen = { 0, 0 };
DWORD cCharsWritten;
CONSOLE_SCREEN_BUFFER_INFO csbi;
DWORD dwConSize;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);

GetConsoleScreenBufferInfo(hConsole, &csbi);
dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
FillConsoleOutputCharacter(hConsole, TEXT(' '), dwConSize, coordScreen, &cCharsWritten);
GetConsoleScreenBufferInfo(hConsole, &csbi);
FillConsoleOutputAttribute(hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten);
SetConsoleCursorPosition(hConsole, coordScreen);
}






4. I assume there is something like the above code specific to linux, but I don't know for sure

--To each his own on the choice. Though I'm sure many have an opinion on which way is best

Share this post


Link to post
Share on other sites
Sorry about the misdefined problem...
Am compiling on VS.NET 2003 for windows.
I think the replies are more than enough ;)

Share this post


Link to post
Share on other sites
Quote:
Original post by KulSeran

4. I assume there is something like the above code specific to linux, but I don't know for sure



Yea there is, it is called ncurses :) check it out if you want it is quite easy and fun :D

Share this post


Link to post
Share on other sites
Quote:
Original post by Ancient Spirit
Yea there is, it is called ncurses :) check it out if you want it is quite easy and fun :D


ncurses is quite good. It also makes it easier to port your code to linux/unix later, if you ever want to.

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!