mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Experimental GPU overclock
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using NvAPIWrapper.Native.Attributes;
|
||||
using NvAPIWrapper.Native.General.Structures;
|
||||
using NvAPIWrapper.Native.Helpers;
|
||||
using NvAPIWrapper.Native.Interfaces;
|
||||
|
||||
namespace NvAPIWrapper.Native.Stereo.Structures
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds information regarding the stereo capabilities of a monitor
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 8)]
|
||||
[StructureVersion(1)]
|
||||
public struct StereoCapabilitiesV1 : IInitializable
|
||||
{
|
||||
internal StructureVersion _Version;
|
||||
internal uint _Flags;
|
||||
internal uint _Reserved1;
|
||||
internal uint _Reserved2;
|
||||
internal uint _Reserved3;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a boolean value indicating if no windowed mode is supported
|
||||
/// </summary>
|
||||
public bool IsNoWindowedModeSupported
|
||||
{
|
||||
get => _Flags.GetBit(0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a boolean value indicating if automatic windowed mode is supported
|
||||
/// </summary>
|
||||
public bool IsAutomaticWindowedModeSupported
|
||||
{
|
||||
get => _Flags.GetBit(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a boolean value indicating if the persistent windowed mode is supported
|
||||
/// </summary>
|
||||
public bool IsPersistentWindowedModeSupported
|
||||
{
|
||||
get => _Flags.GetBit(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
87
app/NvAPIWrapper/Native/Stereo/Structures/StereoHandle.cs
Normal file
87
app/NvAPIWrapper/Native/Stereo/Structures/StereoHandle.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using NvAPIWrapper.Native.Interfaces;
|
||||
|
||||
namespace NvAPIWrapper.Native.Stereo.Structures
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds a handle representing a Device Stereo Session
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct StereoHandle : IHandle, IEquatable<StereoHandle>
|
||||
{
|
||||
internal readonly IntPtr _MemoryAddress;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool Equals(StereoHandle other)
|
||||
{
|
||||
return _MemoryAddress.Equals(other._MemoryAddress);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return obj is StereoHandle handle && Equals(handle);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return _MemoryAddress.GetHashCode();
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString()
|
||||
{
|
||||
return $"StereoHandle #{MemoryAddress.ToInt64()}";
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IntPtr MemoryAddress
|
||||
{
|
||||
get => _MemoryAddress;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsNull
|
||||
{
|
||||
get => _MemoryAddress == IntPtr.Zero;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks for equality between two objects of same type
|
||||
/// </summary>
|
||||
/// <param name="left">The first object</param>
|
||||
/// <param name="right">The second object</param>
|
||||
/// <returns>true, if both objects are equal, otherwise false</returns>
|
||||
public static bool operator ==(StereoHandle left, StereoHandle right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks for inequality between two objects of same type
|
||||
/// </summary>
|
||||
/// <param name="left">The first object</param>
|
||||
/// <param name="right">The second object</param>
|
||||
/// <returns>true, if both objects are not equal, otherwise false</returns>
|
||||
public static bool operator !=(StereoHandle left, StereoHandle right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets default StereoHandle with a null pointer
|
||||
/// </summary>
|
||||
public static StereoHandle DefaultHandle
|
||||
{
|
||||
get => default(StereoHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user