Advertisement Jump to content
Sign in to follow this  
arithma

Console

This topic is 4880 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.

GameDev.net 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!