Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mit-eddie!bloom-beacon!usc!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!dewey.soe.berkeley.edu!oster
From: oster@dewey.soe.berkeley.edu (David Phillip Oster)
Newsgroups: comp.sys.mac.programmer
Subject: Re: How does one determine the current number of bitplanes?
Message-ID: <30603@ucbvax.BERKELEY.EDU>
Date: 13 Aug 89 08:18:11 GMT
References: <16995@ut-emx.UUCP>
Sender: usenet@ucbvax.BERKELEY.EDU
Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster)
Distribution: usa
Organization: School of Education, UC-Berkeley
Lines: 26

In article <16995@ut-emx.UUCP> mentat@walt.cc.utexas.edu (Robert Dorsett) writes:
>The problem facing me is
>how to determine (a) the presence of a color monitor, and (b) the number of
>bitplanes selected on that monitor.

/* myWin is a WIndowPtr parameter */
	SysEnvRec	world;
	Rect		r;
	GDHandle	gd;

	SysEnvirons(1, &world);
	if(world.hasColorQD){
		r = myWin->portRect;
		LocalToGlobal(&topLeft(r));
		LocalToGlobal(&botRight(r));
		gd = GetMaxDevice(&r);
		(**(**gd).gdPMap).pixelSize /* the number of bitplanes */
		TestDeviceAttribute(gd, gdDevType) /* true for color */i
	}

This is all clearly documented in Inside Mac Vol 5, Graphic Devices.


--- David Phillip Oster            --"Unix Version 7 was an improvement not
Arpa: oster@dewey.soe.berkeley.edu --only over its predeccessors, but also its
Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu --successors."