🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #9253

Re: How to discover screen depth

#9253
From: mmm%informatics.rutherford.ac.uk
Date: Wed, 23 Nov 1988 16:06
29 lines
1331 bytes
In Sun-Spots v7n12 Matthew Turk (mit-amt!turk@mit-amt.media.mit.edu) asks
> I have 1-bit and 8-bit monitors hooked up to a Sun.  Is there an easy way
> to find out the screen depth (under Suntools) without creating a new
> window?

I use the following fragment:

	struct pixrect *sc;
	int retn;
	sc = pr_open("/dev/fb");
	if(sc==0)return(0);
	switch(what){
	case ASKXSCREEN:
		retn = sc->pr_size.x;
		break;
	case ASKYSCREEN:
		retn = sc->pr_size.y;
		break;
	case ASKDEPTH:
		retn = sc->pr_depth;
		break;
	}
	pr_close(sc);

Mark M Martin			janet:	mmm@uk.ac.rl.inf
Informatics			arpa:	mmm%inf.rl.ac.uk@nss.cs.ucl.ac.uk
Rutherford Appleton Lab		uucp:	..!mcvax!ukc!rlinf!mmm
Didcot, Oxon, UK. OX11 0QX		mmm@rlinf.uucp
Tel +44 235 44 6756		Fax +44 235 44 5831
Technical Details
Message-ID: <8811160938.AA23635@pyr-a>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!eplrx7!udel!gatech!rutgers!mailrus!cornell!uw-beaver!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!eplrx7!udel!gatech!rutgers!mailrus!cornell!uw-beaver!rice!sun-spots-request
From: mmm%informatics.rutherford.ac.uk@nss.cs.ucl.ac.uk
Newsgroups: comp.sys.sun
Subject: Re: How to discover screen depth
Message-ID: <8811160938.AA23635@pyr-a>
Date: 23 Nov 88 16:06:01 GMT
Sender: usenet@rice.edu
Reply-To: Sun-Spots@Rice.edu
Organization: Rice University, Houston, Texas
Lines: 29
Approved: Sun-Spots@rice.edu
Original-Date: Wed, 16 Nov 88 09:38:01 GMT
X-Sun-Spots-Digest: Volume 7, Issue 26, message 3 of 12