Article View: comp.sys.sun
Article #9338Re: How to discover screen depth
From: josh
Date: Thu, 01 Dec 1988 17:22
Date: Thu, 01 Dec 1988 17:22
26 lines
1102 bytes
1102 bytes
Here is a code fragment that determines the depth of a screen:
#include <suntool/sunview.h>
...
Pixrect *screen;
...
/* open frame buffer */
if ((screen = pr_open("/dev/fb")) == 0)
error("Can't open screen!\n");
if (screen->pr_depth == 1) {
/* Black and white screen */
}
else if (screen->pr_depth == 8) {
/* 8 Bit (gray scale or color) */
}
else {
error("Weird monitor depth: %d\n", screen->pr_depth);
}
...
Joshua Goldstein UUCP: cadnetix!josh
Cadnetix Corp. {uunet,boulder,sunpeaks}!cadnetix!josh
5775 Flatiron Pkwy
Boulder, CO 80301
Technical Details
Message-ID:
<8811181805.AA12286@thorn.cadnetix.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!rutgers!mailrus!cornell!uw-beaver!rice!sun-spots-requestShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!rutgers!mailrus!cornell!uw-beaver!rice!sun-spots-request From: josh@cadnetix.com Newsgroups: comp.sys.sun Subject: Re: How to discover screen depth Message-ID: <8811181805.AA12286@thorn.cadnetix.COM> Date: 1 Dec 88 17:22:30 GMT Sender: usenet@rice.edu Organization: Rice University, Houston, Texas Lines: 26 Approved: Sun-Spots@rice.edu Original-Date: Fri, 18 Nov 88 11:05:43 MST X-Sun-Spots-Digest: Volume 7, Issue 32, message 6 of 17