Archived

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

walkingcarcass

Detecting monitor modes

Recommended Posts

in the SDK description, Direct3D9::EnumAdapterModes fills an array of D3DDISPLAYMODE structures. How big is this array? I expected only one but it sounds like many modes are enumerated for each combination of the Aadapter, Format and Mode paramaters ******** A Problem Worthy of Attack Proves It''s Worth by Fighting Back

Share this post


Link to post
Share on other sites
i just passed the address of a D3DDISPLAYMODE variable. what's gonna be filled into that D3DDISPLAYMODE depends on the Adapter, Format, and the Mode you specified.

Adapter is the video card, so you can only pass one here.
Format is the bit depth, so you also can only pass one here.
and Mode is the index of the mode. you get this number from GetAdapterModeCount(). and this is not an array at all, so you pass only one number here.

and the result is one D3DDISPLAYMODE

if you want to enumerate display modes, use a loop and call EnumAdapterModes inside the loop


    
int ModeCount = pD3D->GetAdapterModeCount( D3DADAPTER_DEFAULT, D3DFMT_X8R8G8B8 );

for ( int AdapterMode = 0 ; AdapterMode < ModeCount ; ++AdapterMode )
{
retval = pD3D->EnumAdapterModes( D3DADAPTER_DEFAULT, D3DFMT_X8R8G8B8, AdapterMode, &m_DisplayMode );
// do something with m_DisplayMode

}


EDIT: some source error


throw Exception( "End of post" );

[edited by - alnite on March 16, 2003 2:14:26 PM]

Share this post


Link to post
Share on other sites