Jump to content
  • Advertisement

Archived

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

Evil Bill

Getting the desktop bit depth

This topic is 5866 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
i think something like GetDeviceCaps(NULL,BITSPIXEL); will return the bpp, but i''m not sure about getting the format.

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!