console formating - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

console formating

Can anyone tell me how i can clear the output screen of

a console app. Is there a function for it? I want to

do this so I can creat an animation effect. I don't just

want to scroll down with a for loop. thanks.




Comments

  • : Can anyone tell me how i can clear the output screen of

    : a console app. Is there a function for it? I want to

    : do this so I can creat an animation effect. I don't just

    : want to scroll down with a for loop. thanks.


    Assuming that you are programming in C/C++, you can always use the standard clrscr() function to clear the console (which is just a text-mode screen). I just don't think that is useful for animation, because you will always get a flickering screen. A smooth way would probably be sort of a double-buffering scheme. Generate your screen in an array and 'draw' it (puts() it) onto screen right over the previous one. No need for a clrscr(). Even better (but I'm not sure how to do that with standard C run-time library functions) is page flipping. I don't know how well or how fast the windows dos-box handles this, but the dos text screen mode (mode 3) has 8 pages you can use.


    Mark


Sign In or Register to comment.