Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.