falahati / NvAPIWrapper

NvAPIWrapper is a .Net wrapper for NVIDIA public API, capable of managing all aspects of a display setup using NVIDIA GPUs
GNU Lesser General Public License v3.0
313 stars 54 forks source link

Request for Sample Code #6

Closed MorGuux closed 6 years ago

MorGuux commented 6 years ago

Hi, I recently discovered this repository, and I am going to use it along with some software I've made.

The software is used as a launcher for racing simulator games (Sim Racing Launcher)

I would like to use this library to get the current settings, exactly like Helios does, and save them if the user requests. Then, the user could change the settings to what they would use when sim racing, and save them again with a different profile.

Then, the user could choose a profile that would be applied on launch, and another profile on exit.

I would like to achieve this in the simplest means possible, I don't need to display any DisplayDevice data or anything, just save a GridTopology object, and apply it at a certain time.

Could you guide me on which commands I would need to run to get the current display settings (for surround or not), and how to re-apply that profile.

Cheers, Morgan

falahati commented 6 years ago

helios it-self is literally the best sample code you can find. In fact, you probably can use it even without changing a line of code. Simply run it with different arguments based on your needs to switch profile and such. You can also modify and incorporate it into your application if the license is compatible.

At the end of that, I am afraid I can't provide any better example than Helios itself.

MorGuux commented 6 years ago

Can you tell me where I can find some documentation on the command line arguments?

falahati commented 6 years ago

You can learn about Helios Command Line options from these .cs files: https://github.com/falahati/HeliosDisplayManagement/blob/master/HeliosDisplayManagement/CommandLineOptions.cs https://github.com/falahati/HeliosDisplayManagement/blob/master/HeliosDisplayManagement.Shared/HeliosStartupAction.cs

These arguments are undocumented, as they are not meant to be used by the end user. But the code is clear enough.