Files
RobustToolbox/Robust.Client/Graphics/Clyde/Clyde.DllMap.cs
Pieter-Jan Briers 1aa9ced157 Removed OpenTK DllMap code.
Wasn't necessary anymore.
2023-02-10 22:57:28 +01:00

23 lines
771 B
C#

using System;
using System.Runtime.InteropServices;
namespace Robust.Client.Graphics.Clyde
{
internal partial class Clyde
{
static Clyde()
{
if (OperatingSystem.IsWindows() &&
RuntimeInformation.ProcessArchitecture == Architecture.X64 &&
Environment.GetEnvironmentVariable("ROBUST_INTEGRATED_GPU") != "1")
{
// We force load nvapi64.dll so nvidia gives us the dedicated GPU on optimus laptops.
// This is 100x easier than nvidia's documented approach of NvOptimusEnablement,
// and works while developing.
NativeLibrary.TryLoad("nvapi64.dll", out _);
// If this fails whatever.
}
}
}
}