Skip to main content
gamedev.net
🔒 Locked

EnumAdapterModes

Started by WebsiteWill Nov 18, 2003 at 3:27 PM 5 replies 2.6k views
Original Post
WebsiteWill
WebsiteWill
Ok. I''m trying to write functions to get lists of available screen sizes and viable refresh rates. I have decided for now that I will stick to _A8R8B8G8 format since the app will definitely be making use of alpha blending. First I am Enumerating my devices (only one device in my case). Then I make a call to GetAdapterModeCount to get a list of all possible modes. I am assuming that this list contains every combination of size x refresh rate allowed be the card? Now the confusing part. I know how many modes there are so I call EnumAdapterModes. I pass it in my adapter number (0 here), the format I am interested in (D3DFMT_A8R8G8B8),a number for the adapter mode generated by for(int i=0; i
JoeyBlow2
JoeyBlow2
The documentation might be wrong.



sAttempt = p_D3D->GetAdapterModeCount(D3DADAPTER_DEFAULT, p_SurfaceFormat);
for(counter = 0; counter < sAttempt; counter++)
{
p_D3D->EnumAdapterModes(D3DADAPTER_DEFAULT, p_SurfaceFormat, counter, &dDM);
if(p_Init->Width == dDM.Width && p_Init->Height == dDM.Height)
{
if(dDM.RefreshRate > highesthz)
{
highesthz = dDM.RefreshRate;
}
}
}



Thats what I do to get the optimal refresh rate. EnumAdapterModes take an index between 0 and N. N is returned as the max in the GetAdapterModeCount. In EnumAdapterModes, the dDM parameter is NOT an array.
WebsiteWill
WebsiteWill
OK that clears it up.

However, another question just sparked. You are using the highest refresh rate as the optimal one but is this actually the case? If so, then is there a need to allow lower refresh rates?

For instance, some games allow you to choose your resolution followed by the refresh rate. But if higher is always better then I am thinking I can simply just allow the user to change screen sizes and always keep the refresh rate at the max allowed by their hardware at that size.

Is this the case? Makes my work easier if so

Webby
JoeyBlow2
JoeyBlow2
Its possible that windows could install a default "standard monitor" driver when it can''t detect the monitor. That default driver might report the monitor can do a higher refresh than it can actually do. So, its still user/system friendly to allow them to pick, but also include an "OPTIMAL" which is set by default.
S1CA
S1CA
1) If Windows/DirectX can''t determine the monitor refresh rate, then what you''ll get back is 0Hz - be prepared for 0.

2) Its the users choice. 60Hz is good for silky smooth arcade graphics - however I _always_ notice it "flickering" as a desktop refresh rate (i.e. lots of static stuff).
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Topic Locked

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

Sign in to reply to this topic.