Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!rochester!pt.cs.cmu.edu!henry.ECE.CMU.EDU!hairston From: hairston@henry.ECE.CMU.EDU (David Hairston) Newsgroups: comp.sys.mac.programmer Subject: Re: What's the screen depth? Message-ID: <12515@pt.cs.cmu.edu> Date: 28 Mar 91 18:44:19 GMT References: <1991Mar28.110336.40826@eagle.wesleyan.edu> Organization: Gaia II Lines: 27 [rcook@eagle.wesleyan.edu writes:] [] Here's the problem: I know how to sense if a machine has Color QuickDraw, [] but how do you detect the bit depth/color mode? I don't want to move to [] color windows, because I want to keep only one set of drawing routines, [] thus not keeping parallel sets for standard and color quickdraw. if you're certain that all you want is bit depth then try: short bit_depth = 1; if (theWorld.hasColorQD) /* SysEnvirons, Gestalt may be better */ bit_depth = (** (** GetGDevice()).gdPMap ).pixelSize; this gets the bit depth of the current screen. you can make similar calls to get the bit depth of the "main screen" and the screen with the maximum bit depth. for more details on graphics device calls see: Inside Macintosh Vol. 5, Chap. 5, Graphics Devices. btw, in my experience, the major problem with moving to color windows is checking for color QD before using routines like GetGDevice() and NewCWindow(). it is real easy to forget this check (i know!). the drawing routines usually work in either case but you can't use new drawing routines, obviously, if color quickdraw isn't present. -dave- hairston@henry.ece.cmu.edu