Skip to main content
gamedev.net
🔒 Locked

GetAdapterModeCount() - issue

Started by Hotshot5000 4 replies 2k views
Original Post
Hotshot5000
Hotshot5000
I am checking the supported formats with GetAdapterModeCount() and it is always returning 0. The formats that I checked are as follows: D3DFMT_X1R5G5B5 D3DFMT_A2R10G10B10 D3DFMT_X8R8G8B8 D3DFMT_R5G6B5 D3DFMT_X1R5G5B5 D3DFMT_X8R8G8B8 and they all return 0 for adapter 0 (default adapter). Any ideas what might be wrong?
Evil Steve
Evil Steve
You probably don't have D3D9 drivers installed. What does dxdiag say? Do any of the SDK samples work? Anything from the Debug Runtimes?
Hotshot5000
Hotshot5000
Everything works. I have even animated tiny from sdk. I have created a small engine that had fixed values when creating the d3d device and now I am trying to create a dialog box so the user can select the adapter format, backbuffer format, HAL or REF, etc..But now I have the issue with GetAdapterModeCount() and it's really annoying
This is the sample
for(int i = 0; i < m_AdapterCount; ++i)
{
m_Dev->GetDeviceCaps(i, m_HalDevType, &m_Caps.HAL);
m_Dev->GetDeviceCaps(i, m_RefDevType, &m_Caps.REF);
m_Dev->GetAdapterIdentifier(i, 0, &m_adapter_ident);

m_AdapterModeCount[i * 6] = m_Dev->GetAdapterModeCount(i, D3DFMT_X1R5G5B5);
m_AdapterModeCount[i * 6 + 1] = m_Dev->GetAdapterModeCount(i, D3DFMT_A2R10G10B10);
m_AdapterModeCount[i * 6 + 2] = m_Dev->GetAdapterModeCount(i, D3DFMT_X8R8G8B8);
m_AdapterModeCount[i * 6 + 3] = m_Dev->GetAdapterModeCount(i, D3DFMT_R5G6B5);
m_AdapterModeCount[i * 6 + 4] = m_Dev->GetAdapterModeCount(i, D3DFMT_X1R5G5B5);
m_AdapterModeCount[i * 6 + 5] = m_Dev->GetAdapterModeCount(i, D3DFMT_X8R8G8B8);

}
Ignore the i * 6 + x part...
Evil Steve
Evil Steve
And what do the debug runtimes say? If the function is failing, they'll tell you why.
Hotshot5000
Hotshot5000
It's not failing. It just returns 0 for every format.
Finally! There was something wrong with the ide..it just said that everything is 0 but when I wrote this:
m_Modes = 0;
for(int i = 0; i < 6 * m_AdapterCount; ++i)
m_Modes += m_AdapterModeCount;
m_Modes is 86 after all iterations...Well at least I know it works. Thanks for the replies and sorry for wasting time on such a stupid issue
Evil Steve
Evil Steve
Quote:
Original post by Hotshot5000
It's not failing. It just returns 0 for every format.
How do you know it's not failing? What do the debug runtimes say?

EDIT: Ah, you edited your post [smile]
Are you trying to debug a release build? Strange things happen when you do that.

Topic Locked

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

Sign in to reply to this topic.