Archived

This topic is now archived and is closed to further replies.

Evil Bill

Getting the desktop bit depth

Recommended Posts

Anyone know how to get the bit depth of the screen (pref. a Win32 function)? I need to create a window D3D window, and it fails if the bit depth of the backbuffer is different from that of the screen. Cheers, Steve Steve
DirectX Programmer
Soon to be the new Bill Gates

Share this post


Link to post
Share on other sites
I do this:

D3DDISPLAYMODE d3ddm;
if( FAILED( m_pD3D->GetAdapterDisplayMode( D3DADAPTER_DEFAULT, &d3ddm ) ) )
return E_FAIL;

then d3dmm.Format will be what you're after, so can just set the backbuffer format to the same.

look in the sdk for D3DFORMAT for the different types.

[edited by - helicon56 on May 1, 2002 2:47:36 PM]

Share this post


Link to post
Share on other sites
Hmm... thats what ive got, but i''d prefer a non-D3D way.
The reason being that i''ve got my D3D renderer in a DLL, and i''d prefer not to have a function GetDesktopBitDepth() just to eliminate modes that are different from the desktop bit depth if the window isn''t fullscreen.

Cheers, Steve

Steve
DirectX Programmer
Soon to be the new Bill Gates

Share this post


Link to post
Share on other sites
Perfect! Thats what i was looking for! I was looking through GetSystemMetrics() but couldn''t find anything - now i know why.

Cheers, Steve

Steve
DirectX Programmer
Soon to be the new Bill Gates

Share this post


Link to post
Share on other sites