From 68ef93bd9a0636fce447f0628836c7d5a5a02f8e Mon Sep 17 00:00:00 2001 From: Light Date: Sat, 7 Aug 2021 16:39:42 +0430 Subject: [PATCH] Force use Dedicated Graphics - Windows builds now use dedicated graphics --- Engine/src/Platform/OS/Windows/wWindow.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Engine/src/Platform/OS/Windows/wWindow.cpp b/Engine/src/Platform/OS/Windows/wWindow.cpp index 3e54f2c..3f2c553 100644 --- a/Engine/src/Platform/OS/Windows/wWindow.cpp +++ b/Engine/src/Platform/OS/Windows/wWindow.cpp @@ -12,6 +12,13 @@ #include +extern "C" +{ + // Force Machine to use Dedicated Graphics + __declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; // NVidia + __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; // AMD +} + namespace Light { Scope Window::Create(std::function callback) @@ -40,7 +47,7 @@ namespace Light { BindGlfwEvents(); // create graphics context - m_GraphicsContext = GraphicsContext::Create(GraphicsAPI::DirectX, m_Handle); + m_GraphicsContext = GraphicsContext::Create(GraphicsAPI::OpenGL, m_Handle); LT_ENGINE_ASSERT(m_GraphicsContext, "wWindow::wWindow: failed to create 'GraphicsContext'"); }