Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Sep 1995 14:33:14 -0400 (EDT)
From:      Chuck Robey <chuckr@eng.umd.edu>
To:        Antonio Navarro <bemar@servicom.es>
Cc:        questions@freebsd.org
Subject:   Re: Using color in C 
Message-ID:  <Pine.SUN.3.91.950925142653.11515B-100000@mocha.eng.umd.edu>
In-Reply-To: <9509251840.AA12127@servicom.es>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 25 Sep 1995, Antonio Navarro wrote:

> Hello !
> 
> I am trying to use colors under C. How can I show colors on the 
> screen (something similar to the COLOR statement in Basic) ?. I 
> have read the source code of the vidcontrol program (because 
> you can obtain 16 colors when you execute the vidcontrol 
> utility with the 'show' keyword), but I do not understand the 
> sequences to obtain color.

C, unlike Basic, has no direct support for color or screens.  That is not 
to say that it can't be done, but it means that C relies on calls from 
the underlying operating system (which you have to make, in C) to get 
machine control things like that done.  In this case, it means you'll 
have to use ioctl calls (see the ioctl man page) tp get what you want 
done, but here, you're in luck.  Because FreeBSD includes source code, go 
look at the code in the vidcontrol utility itself  
(/usr/src/usr.sbin/vidcontrol) and see how someone else did it.

> 
> Thanks in advance.
> 
> Antonio Navarro
> L'Eliana - Valencia (Spain)
> 
> 
> 

----------------------------+-----------------------------------------------
Chuck Robey                 | Interests include any kind of voice or data 
chuckr@eng.umd.edu          | communications topic, C programming, and Unix.
9120 Edmonston Ct #302      |
Greenbelt, MD 20770         | I run Journey2 and n3lxx, both FreeBSD
(301) 220-2114              | version 2.2 current -- and great FUN!
----------------------------+-----------------------------------------------




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SUN.3.91.950925142653.11515B-100000>