Skip to main content
gamedev.net
🔒 Locked

Getting the windows bit depth

Started by Bleakcabal Jun 18, 2002 at 8:21 PM 3 replies 250+ views
Original Post
Bleakcabal
Bleakcabal
Is there a way to get the windows bit depth on which the programming is currently running. I have started programming a simple app, but I want to know at which bit depth the user is running. The only thing I have been able to come up with is the resolution of the screen but thats not what I need. WHO DO THEY THINK THEY''RE FOOLING : YOU ?
WHO DO THEYTHINK THEY'REFOOLING : YOU ?
IndirectX
IndirectX
EnumDisplaySettings?
---visit #directxdev on afternet <- not just for directx, despite the name
LessBread
LessBread
How 'bout GetDeviceCaps(hdc,BITSPIXEL)?

// EDIT:
This is probably better

GetDeviceCaps(hdc,COLORRES)

quote:

BITSPIXEL Number of adjacent color bits for each pixel

COLORRES Actual color resolution of the device, in bits per pixel. This index is valid only if the device driver sets the RC_PALETTE bit in the RASTERCAPS index and is available only if the driver is compatible with 16-bit Windows.



[edited by - lessbread on June 18, 2002 9:44:36 PM]
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Jeff K
Jeff K
bpp = GetDeviceCaps(hdc, PLANES) * GetDeviceCaps(hdc, BITSPIXEL);
Bleakcabal
Bleakcabal
Thanks alot.

EDIT:
For reference, I have tried both the
GetDeviceCaps(hdc,COLORRES)
and the
GetDeviceCaps(hdc, PLANES) * GetDeviceCaps(hdc, BITSPIXEL);
methods, and in the second one seems to work better. In 32 bpp for instance the first method gives 24 while the second gives 32.

In 16 bpp the first method gives 24 while the second one gives 16.

And again thanks to everyone !

WHO DO THEY
THINK THEY'RE
FOOLING : YOU ?





[edited by - bleakcabal on June 19, 2002 10:19:37 AM]
WHO DO THEYTHINK THEY'REFOOLING : YOU ?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.