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
Getting the desktop bit depth
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]
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]
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
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
i think something like GetDeviceCaps(NULL,BITSPIXEL); will return the bpp, but i''m not sure about getting the format.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement