Jump to content

  • Log In with Google      Sign In   
  • Create Account


IDirect3D9::GetAdapterDisplayMode


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 XGT08   Members   -  Reputation: 110

Like
0Likes
Like

Posted 21 July 2014 - 01:00 PM

Hello,

 

I am a little confused about how the 'IDirect3D9::GetAdapterDisplayMode' function works when we have multiple adapters on our system.

 

For example, calling this function and passing it an ordinal of 1 on a system with 2 adapters. If that adapter is not currently active, what will be the display mode returned by the function?

 

I applogize if the question is silly or weird. It's probably due to the fact that I always had one adapter on my system and I have no idea what are the implications of using multiple adapters smile.png.

 

Thanks a lot!



Sponsor:

#2 Buckeye   Crossbones+   -  Reputation: 4584

Like
1Likes
Like

Posted 21 July 2014 - 01:50 PM


If that adapter is not currently active, what will be the display mode returned by the function?

 

The documentation (do you have the docs?) provides:

If Adapter is out of range or pMode is invalid, this method returns D3DERR_INVALIDCALL.

 

 

You could also try it and examine values. wink.png


Edited by Buckeye, 21 July 2014 - 01:51 PM.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.


#3 XGT08   Members   -  Reputation: 110

Like
0Likes
Like

Posted 21 July 2014 - 02:08 PM

Hello,

 

Thanks for the answer :)

 

I read the documentation, but from what it says I understand that if the adapter ordinal that you supply is bigger than the GetAdapterCount() - 1, it returns D3DERR_INVALIDCALL..

 

I would gladly try it, but I am using a laptop. I don't know... Is it possible to have more than one adapter on your laptop? Anyway, I was just hoping somebody would know the answer to this :).

 

The reason I am asking this question is because I saw this function being called in this way in a device enumeration code module. After the enumeration process, the client code can call a function like FindBestFullscreenMode(DisplaySettings& settings, D3DDISPLAYMODE& matchMode, bool bRequireHAL, bool bRequireREF). This function attempts to find an adapter which matches the requested settings as closely as possible (i.e. has a matching display mode with matchMode, and uses a HAL or REF device, depending on the values of 'requireHAL' and 'requireREF').

 

Inside the function there is a loop which does somehting like this:

 

for(UINT adapterIndex = 0; adaperIndex < adapterCount; adapterIndex++)

{

     D3DDISPLAYMODE displayMode;

     direct3D9->GetAdapterDisplayMode(adapters[adapterIndex]->Oridnal, &displayMode);

 

     // The rest of the code...
}

 

... where 'adapterCount' is the current number of adapters installed on the system and 'adapters' is a std::vector which contains instances of a class which holds adapter information (like the adapter ordinal for example).



#4 Dave Hunt   Crossbones+   -  Reputation: 2435

Like
0Likes
Like

Posted 21 July 2014 - 02:19 PM

GetAdapterDisplayMode() will return a mode for every adapter in the range 1..GetAdapterCount(). If GetAdapterCount() can see it, then it is fair game for access.



#5 XGT08   Members   -  Reputation: 110

Like
0Likes
Like

Posted 21 July 2014 - 02:23 PM

Thanks Dave.

 

That's cool, but if I call this function specifying an ordinal which identifies an adapter installed on my system but which is currently inactive (i.e. it is not currenlty rendering my dekstop), then what is the returned display mode?



#6 Dave Hunt   Crossbones+   -  Reputation: 2435

Like
0Likes
Like

Posted 21 July 2014 - 02:35 PM

If it's enabled, it gets a number, if it's completely disabled somehow, then it doesn't. If it gets a number, then it's accessible. DirectX won't skip numbers for disabled devices, it will ignore them completely. There won't be a case where ordinal #2 is valid as an argument to the various DirectX methods and ordinal #1 is not.

 

What is the returned display mode? I have no idea, but you can bet it will be a valid one.



#7 XGT08   Members   -  Reputation: 110

Like
0Likes
Like

Posted 21 July 2014 - 02:40 PM

Thanks Dave! :)






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS