Clear Screen

Submerge

Newbie
Joined
Jun 2, 2003
Messages
432
Reaction score
0
How do you guys go about clearing the screen on a C++ application since there is no official way to do it. I'd just like to know the best way since im starting out.
:cheers:

my teacher is talking about a header file:
#include <msoftcon.cpp>

but she says it doesn't always work and it's not accepted officially in c++ books cuz it has errors. anyone got an error free way?
 
VOID g_Application::ClearScreen()
{
DDBLTFX clsBltFX;
ZeroMemory(&clsBltFX, sizeof(clsBltFX));
clsBltFX.dwSize = sizeof(clsBltFX);
lpddsBack->Blt(0, 0, 0, DDBLT_COLORFILL | DDBLT_WAIT, &clsBltFX);
}


:D

edit: btw that code is a copyrighted part of my upcoming game, avanti ;)
 
for ( int i = 0; i < 100; i++ )
{
cout << endl;
}

:p (joking)
 
^wat does that do...im just starting out so im not that much knowing of everything u stated.
 
Originally posted by rootbin
VOID g_Application::ClearScreen()
{
DDBLTFX clsBltFX;
ZeroMemory(&clsBltFX, sizeof(clsBltFX));
clsBltFX.dwSize = sizeof(clsBltFX);
lpddsBack->Blt(0, 0, 0, DDBLT_COLORFILL | DDBLT_WAIT, &clsBltFX);
}


:D

edit: btw that code is a copyrighted part of my upcoming game, avanti ;)

thus i can't use it right.
 
Yeah the DirectX bit won't help you much lol...

There's some bass-ackwards way that M$ lets you do it with their weird console API stuff, or, yeah, you can use

system("cls");

...which will run the "cls" command, which clears the screen. I remember seeing a clrscr() function or something a long time ago, but MSVC didn't support it. Maybe it was just a Borland thing...

-Syko
 
clrscr, I remember using that when I was learning c. which was only last year. So, clrscr should work, at least if you are using gcc.
 
what about just #include <conio.h> clrscr(); or are we talking about win32 programs here?
 
clsscr worked under the djgpp compiler, and that used a mainstream standard didn't it? That SHOULD work.
 
Back
Top