From owner-freebsd-questions Mon Sep 25 11:33:36 1995 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id LAA18977 for questions-outgoing; Mon, 25 Sep 1995 11:33:36 -0700 Received: from chemserv.umd.edu (chemserv.umd.edu [129.2.64.40]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id LAA18961 for ; Mon, 25 Sep 1995 11:33:29 -0700 Received: from mocha.eng.umd.edu (mocha.eng.umd.edu [129.2.98.16]) by chemserv.umd.edu (8.7.Beta.14/8.7.Beta.14) with ESMTP id OAA00437; Mon, 25 Sep 1995 14:33:17 -0400 (EDT) Received: (chuckr@localhost) by mocha.eng.umd.edu (8.7/8.6.4) id OAA12390; Mon, 25 Sep 1995 14:33:15 -0400 (EDT) Date: Mon, 25 Sep 1995 14:33:14 -0400 (EDT) From: Chuck Robey To: Antonio Navarro cc: questions@freebsd.org Subject: Re: Using color in C In-Reply-To: <9509251840.AA12127@servicom.es> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org Precedence: bulk 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! ----------------------------+-----------------------------------------------