0
\$\begingroup\$

I've done DirectX apps for 1.5 years now, mainly to teach myself but now i would like to make games for public. So i was wondering would it work for others just leaving the values default ie. swap chain's refresh rate to 60 without checking the users monitors refresh rate. Could you tell me what things should not be ignored in situations like this, thanks.

There's no SDL or SFML in my programs just pure C++, DirectX and WinAPI.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

The most compatible solution is to use 'windowed' mode and leave all those values at the default. Refresh rate, resolution, etc. only come into play with 'exclusive fullscreen' mode which can be quite challenging to implement robustly. The Universal Windows Platform (UWP) on Windows 10 does not support 'exclusive fullscreen' rendering because of numerous issues with getting it right.

The best solution is to leave the user's display resolution alone and use a borderless window that fills the whole display. You can deal with the performance impacts by using a smaller render target and then scale it up. With UWP you can use DXGI_SCALING_ASPECT_RATIO_STRETCH which deals with it automatically, or for classic desktop apps you can use DXGI_SCALING_STRETCH or do your own aspect-aware scaling. This is the solution I implement in my Direct3D Game VS Templates.

Another common solution is to use 'fake-fullscreen' where you use a windowed mode with a borderless fullscreen window and change the display resolution. This only works for classic desktop apps, and does have some of the downsides of 'exclusive fullscreen' mode as you have to be careful about exactly what resolution you request, handle an automatic fallback for failure, etc.

I suggest you take a look at the DeviceResources (DX11 or DX12) class as a good starting point. See also Anatomy of Direct3D 11 Create Device and Anatomy of Direct3D 12 Create Device.

\$\endgroup\$
1
  • \$\begingroup\$ + 1; the biggest issue with exclusive fullscreen modes I've found is actually that mentioned by the OP - refresh rate. The 60 Hz you think you have is probably not 60 Hz at all, and it's vital to properly enumerate display modes and pay attention to the Numerator and Denominator members. Second biggest issue is handling windowed/fullscreen transitions and calling MakeWindowAssociation properly. \$\endgroup\$ Commented Aug 31, 2016 at 19:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .