using System; using NvAPIWrapper.Native; using NvAPIWrapper.Native.Stereo; using NvAPIWrapper.Native.Stereo.Structures; namespace NvAPIWrapper.Stereo { /// /// Represents an application registry configuration profile as well as providing static access to system-wide and /// application-wide stereo configurations. /// public class StereoApplicationConfiguration { private StereoApplicationConfiguration(StereoRegistryProfileType profileType) { ProfileType = profileType; StereoApi.CreateConfigurationProfileRegistryKey(profileType); } /// /// Gets the default configuration profile for the current application /// public static StereoApplicationConfiguration DefaultConfigurationProfile { get; } = new StereoApplicationConfiguration(StereoRegistryProfileType.DefaultProfile); /// /// Gets the currently default profile name. /// public static string DefaultProfile { get => StereoApi.GetDefaultProfile(); } /// /// Gets the DirectX 10 configuration profile for the current application. /// Use this property if only your application supports multiple DirectX versions. /// Otherwise consider using the property. /// public static StereoApplicationConfiguration DirectX10ConfigurationProfile { get; } = new StereoApplicationConfiguration(StereoRegistryProfileType.DirectX10Profile); /// /// Gets the DirectX 9 configuration profile for the current application. /// Use this property if only your application supports multiple DirectX versions. /// Otherwise consider using the property. /// public static StereoApplicationConfiguration DirectX9ConfigurationProfile { get; } = new StereoApplicationConfiguration(StereoRegistryProfileType.DirectX9Profile); /// /// Gets a boolean value indicating if the stereo mode is enable in the registry. /// public static bool IsStereoEnable { get => StereoApi.IsStereoEnabled(); } /// /// Gets a boolean value indicating if the windowed mode stereo is supported /// public static bool IsWindowedModeSupported { get => StereoApi.IsWindowedModeSupported(); } /// /// Gets the stereo registry profile type associated with this instance. /// public StereoRegistryProfileType ProfileType { get; } /// /// Disables the stereo mode in the registry. The effect is system wide. /// public static void DisableStereo() { StereoApi.DisableStereo(); } /// /// Enables the stereo mode in the registry. The effect is system wide. /// public static void EnableStereo() { StereoApi.EnableStereo(); } /// /// Gets the monitor capabilities for the passed monitor handle. /// /// The monitor handle represented by a pointer. /// The stereo capabilities of the monitor. public static StereoCapabilitiesV1 GetMonitorCapabilities(IntPtr monitorHandle) { return StereoApi.GetStereoSupport(monitorHandle); } /// /// Sets the default stereo profile used by the driver in case te application has no associated profile. /// For the changes to take effect, this method must be called before creating a D3D device. /// /// public static void SetDefaultProfile(string profileName) { StereoApi.SetDefaultProfile(profileName); } /// /// Sets the 3D stereo driver mode. /// /// public static void SetDriverMode(StereoDriverMode driverMode) { StereoApi.SetDriverMode(driverMode); } /// /// Deletes the entire profile's registry key and therefore resets all customized values. /// public void DeleteAllValues() { StereoApi.DeleteConfigurationProfileRegistryKey(ProfileType); StereoApi.CreateConfigurationProfileRegistryKey(ProfileType); } /// /// Removes the given value from the profile's registry key. /// /// public void DeleteValue(StereoRegistryIdentification valueId) { StereoApi.DeleteConfigurationProfileValue(ProfileType, valueId); } /// /// Sets the given value under the profile's registry key. /// /// The identification of the value to be set. /// The actual value being set. public void SetValue(StereoRegistryIdentification valueId, float value) { StereoApi.SetConfigurationProfileValue(ProfileType, valueId, value); } /// /// Sets the given value under the profile's registry key. /// /// The identification of the value to be set. /// The actual value being set. public void SetValue(StereoRegistryIdentification valueId, int value) { StereoApi.SetConfigurationProfileValue(ProfileType, valueId, value); } } }