delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/06/20/17:15:19

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Colours
Date: 20 Jun 2001 19:08:15 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 21
Message-ID: <9gqsav$rvo$1@nets3.rz.RWTH-Aachen.DE>
References: <993062430 DOT 11148 DOT 0 DOT nnrp-13 DOT c1ed4a47 AT news DOT demon DOT co DOT uk>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 993064095 28664 137.226.32.75 (20 Jun 2001 19:08:15 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 20 Jun 2001 19:08:15 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Steve B <knurd62 AT hotmail DOT com> wrote:
> Hi,
> Im programming a text adventure game using DJGPP
> and im wondering how to use colours (with <iostream>
> and cout) in c++.

In a nutshell: you don't. Not with <iostream> stuff, that is.

> Ive heard something about using ANSI escape sequences but im not
> sure how to use these for colours.

You can do that, right. But that'd mean you'ld have to assume that all
users of the program will have the ANSI.SYS driver loaded --- on some
platforms or for some users, that may be impossible.

You'll probably have to move from <iostream> to a <strstream> or
<sstream>, and use functions from <conio.h> to do the actual output to
screen, later.
-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019