Clearing the screen?

Discuss all aspects of programming here.

Moderator: The Mod Squad

Clearing the screen?

Postby Snowfire » Tue Apr 19, 2005 10:20 am

Hello all, I was just wondering how I would go about clearing the screen in C++. I'm using Microsoft Visual C++ v6.0, and using a C++ Source file. I haven't yet learned how to program a Win32API yet, so hopefully that info helps you determine what would be best. I am basically trying to make a Text-Based RPG sort of like Materia Magica, but a single player version. Right now I'm trying to clear the screen after displaying the main menu and letting the user make their choice. I'm trying to take this step by step really. Once the user get's into the actual game, I'm trying to display the area and the player's info (Health, Stamina, and later I'll add in Spell Points) and then let them make their choice. We'll, I think that I've given enough info to get you started. If you've played the game, shout out some suggestions for how to do certain things. If you haven't played it, CHECK IT OUT! It is so much fun, and then you would be able to help out. In fact, if some people made some classes for certain functions, than we could all work on it. Well, have at it! :twisted:
Tono Sien


Love is the greatest conspiracy, by the most loving genius.
Snowfire
Black Belt 1st Degree
Black Belt 1st Degree
 
Posts: 1486
Joined: Sun May 11, 2003 8:47 pm
Location: Omaha, NE

Postby Roach412 » Tue Apr 19, 2005 11:23 am

this shows a way of creating your own little clearscreen function.

http://cpp.enisoc.com/articles/clrscr/

unless you are using the Borland-type C++ compiler, there's no built-in clearscrean.

-Roach
Lian Li Lancool First Knight Series PC-K59W
Intel Core i7-960 Bloomfield 3.2GHz
EVGA X58 FTW3 132-GT-E768-TR
EVGA GeForce GTX 1070 FTW GAMING ACX 3.0
G.SKILL Ripjaws Series 12GB (3 x 4GB)
Crucial M4 128gb SATAIII SSD x2
Crucial M4 256gb SATAIII SSD
OCZ Saber 1000 960GB Enterprise SSD
Corsair Professional Series HX850 PSU
Dell UltraSharp U2713HM 27" w/drop ceiling mount
Logitech G930 7.1 Headset
DBPOWER RGB LED Keyboard
Logitech G402 Hyperion Fury
Roach412
Black Belt 2nd Degree
Black Belt 2nd Degree
 
Posts: 2714
Joined: Mon Aug 09, 2004 7:33 pm
Location: Milwaukee - Wisconsin

Postby Snowfire » Wed Apr 20, 2005 10:12 am

Alrighty, got it to work with the system("cls"), now I'm just trying to get this to compile without any errors and try to move on.
Tono Sien


Love is the greatest conspiracy, by the most loving genius.
Snowfire
Black Belt 1st Degree
Black Belt 1st Degree
 
Posts: 1486
Joined: Sun May 11, 2003 8:47 pm
Location: Omaha, NE

Postby adrianxw » Wed Apr 20, 2005 10:16 am

The system() function is a poor choice for Windows, it has a real performance hit which can mount up if you use it often.

You may be interested in my 6 part console programming tutorial. It uses API routines starts slowly but gets into some quite sophisticated techniques. Clearing the screen is covered in part 2.

http://www.adrianxw.dk/SoftwareSite/Con ... oles1.html
Wave upon wave of demented avengers march cheerfully out of obscurity into the dream.
adrianxw
Initiate
Initiate
 
Posts: 53
Joined: Tue Jan 27, 2004 1:52 pm
Location: Denmark

Postby netaces2k » Sat Dec 17, 2005 11:50 pm

a simple way to clear the screen is to call the ANSI handler. and pass an ESC[2J to the handler at the point you want the screen cleared.
netaces2k
 

Postby Snowfire » Wed Dec 21, 2005 7:52 am

Dear lord man! That was half a year ago! I passed with flying colors! Not to mention I kinda surpassed the knowledge of my teacher in some areas! :oops:

Now though, I'm sorting through the source for Quake 3, and am thinking about doing a total conversion with the source... Either way, I'm gonna have some fun!
Tono Sien


Love is the greatest conspiracy, by the most loving genius.
Snowfire
Black Belt 1st Degree
Black Belt 1st Degree
 
Posts: 1486
Joined: Sun May 11, 2003 8:47 pm
Location: Omaha, NE

Postby DAVE1 » Wed Dec 21, 2005 11:41 am

what class is this that your doing all of this?
Join team 33258 today!!
DAVE1
Mobo-fu Master
Mobo-fu Master
 
Posts: 7699
Joined: Sat May 14, 2005 11:49 am

Postby Snowfire » Wed Dec 21, 2005 8:00 pm

Well I WAS taking a C++ class last school year, but now I'm not taking a class for programming. I am hoewever doing an independent study course on 3D modeling and animation using Maya and 3Ds Max... I'm hoping to incorporate the two classes over the summer with my buddies and either complete a mod, or do a total conversion...
Tono Sien


Love is the greatest conspiracy, by the most loving genius.
Snowfire
Black Belt 1st Degree
Black Belt 1st Degree
 
Posts: 1486
Joined: Sun May 11, 2003 8:47 pm
Location: Omaha, NE


Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests