Jump to content

  • Log In with Google      Sign In   
  • Create Account


Finding 'allowed' resolutions?


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
4 replies to this topic

#1 george7378   Members   -  Reputation: 1185

Like
0Likes
Like

Posted 19 March 2013 - 06:00 AM

Hi everyone,

 

It seems like a simple question, but how do I find out which resolutions are permitted by the chosen device? For example, when I create my device, it will only permit me to pass certain values for screen width and height into my perspective matrix.It works if I specify 1024x768, but it will fail to initialise D3D if I specify 1023x768, for example. There doesn't seem to be a place in the D3DCAPS9 structure for info about permitted resolutions - where can I find out about them?

 

Thanks!



Sponsor:

#2 slicer4ever   Crossbones+   -  Reputation: 3490

Like
1Likes
Like

Posted 19 March 2013 - 06:13 AM

http://msdn.microsoft.com/en-us/library/dd162611%28v=vs.85%29.aspx

 

AFAIK that's the method you have to use.


Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

#3 Schrompf   Prime Members   -  Reputation: 954

Like
0Likes
Like

Posted 19 March 2013 - 06:45 AM

I use exactly this function. It works fine and is simple enough, but but warned: it lies occasionally. Especially the refresh rates it reports are wrong for certain display devices - overhead projectors are notorious for this, older monitors as well, or analogue-cable-connected displays. 

 

So my suggestion for a reasonably well-behaving game is: use this function, filter out the resolutions your game can't handle, always use the default refresh rate whatever the monitor tells you, and you'll still need one of these obnoxious "Press OK to keep this resolution. Will switch back to previous setting in 15... 14..." dialogs to be safe.


----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.

#4 belfegor   Crossbones+   -  Reputation: 2560

Like
2Likes
Like

Posted 19 March 2013 - 09:20 AM

What about this method?

 

IDirect3D9::EnumAdapterModes


Edited by belfegor, 19 March 2013 - 09:21 AM.


#5 mhagain   Crossbones+   -  Reputation: 7823

Like
2Likes
Like

Posted 19 March 2013 - 10:36 AM

What about this method?

 

IDirect3D9::EnumAdapterModes

 

I'd run with this rather than using the Win32 API function for a number of reasons.

 

Firstly, it's going to give you a list of modes that are more likely to work with D3D.  The Win32 function may give you all manner of weird and wacky modes for which hardware acceleration is unavailable, you may have to filter out 8bpp modes, etc.

 

Secondly, the D3DFORMAT and refresh rate it gives you can be safely plugged into your D3DPRESENT_PARAMETERS without any doubts.  Using Win32, if you get - say - a 32bpp mode, can you be certain that it's D3DFMT_X8R8G8B8?  Or D3DFMT_A8R8G8B8?  Or even D3DFMT_A2R10G10B10?  What about 16bpp modes?  There are another 3 variations on those.

 

What it comes down to is: if D3D provides a call for enumerating modes, then there's a good chance that actually using that call will be the preferred option.


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.





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