Path: utzoo!utgpu!cunews!bnrgate!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request From: st-andy!larry@uunet.uu.net (Larry Martell) Newsgroups: comp.sys.sun Subject: Re: Frame buffer depth Keywords: No Digest Subjects in Unmoderated Mode Message-ID: <3598@brchh104.bnr.ca> Date: 5 Jun 91 14:17:00 GMT Sender: news@brchh104.bnr.ca Organization: Sunspots, Pseudo-Unmoderated Lines: 29 Approved: sun-spots@rice.edu X-Original-Date: Fri, 24 May 1991 14:14:56 GMT In article <2883@brchh104.bnr.ca> crawford@eagle.crd.ge.com (Carl Crawford) writes: >I am using a number of Sparcstations under Sunview. Some of the Sparcs are >1 bit monochrome and some are 8 bit gray scale. From within a program how >can you tell which frame buffer your system has? > The depth of the frame buffer is kept in the pw_pixrect->pr_depth member of the Pixwin struct. For a window you get a pointer to the Pixwin struct using window_get: Canvas canvas; Pixwin *pw; pw = (Pixwin *)window_get(canvas,WIN_PIXWIN); For a canvas use canvas_pixwin: pw = (Pixwin *)canvas_pixwin(canvas); In ether case the frame buffer depth can be found in: pw->pw_pixrect->pr_depth See page 108 of ther SunView Programmers Guide: "Is My Application Running on a Color Display?" -- Larry Martell "Opinions are like assholes; everybody has one, 212-668-9478 but nobody wants to look at the other guys" uunet!st-andy!larry