Zayats
Zayats

Reputation: 281

DirectX Device Options

Almost all games today have a video options menu where you can choose the quality of textures, shaders, shadows, resolution etc. I'm just wondering how I could find the available options? (like if the user has a 1080x1050 screen, there shouldn't be an option for 1920x1200 resolution)

If that's not how it works, do I have to build a list of features and just allow the user choose choose any of them? How would I do that? I'm using C++ by the way.

Upvotes: 1

Views: 379

Answers (1)

IronMensan
IronMensan

Reputation: 6831

Based on the comments, it sounds like you won't be doing any of this for a while, but if/when you do, there is no magic wand, you have to have to deal with all the options individually and it depends on the features you support.

For example, with textures, the "low" option could mean that you don't load the highest mip and instead start with the second highest.

You can do something similar with the LODs of your models.

A lot of the options are versions of your shaders. So you can write one shaded that supports four dynamic lights, another version that supports one and a third version that doesn't support any. Then you have other options, like the number of texture passes and shadow generation techniques. This leads to a combinatorial explosion of shader versions. So most games will have a way of stitching chunks of shader code together to form the combination of options they want for each model and the quality settings.

The screen resolution options are the most straight-forward. Depending on which version of DirectX you are using, there are different functions you can call to enumerate the fullscreen modes that are supported by the device. For example EnumAdapterModes on DirectX 9 and EnumAdapters on DirectX 10.

Upvotes: 2

Related Questions