The easiest way from C ++ to use a dedicated graphics card instead of switchable graphics on a chipset under Windows is to export the following characters (MSVC code example):
Enable dedicated graphics for NVIDIA :
extern "C" { __declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; }
Enable dedicated graphics for AMD Radeon :
extern "C" { __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; }
Warning. If the user created a profile for the application to use the integrated chipset, then this will not work.
I am not sure if this will work similarly to Linux / MacOS (unlikely).
Christopher oezbek
source share