I am part of a team developing an application using C++ with SDL and OpenGL.
On laptops when the application is ran the dedicated graphics card is not used and the GL context fails to create because the integrated graphics card does not support the version of GL we want.
I have a feeling that this problem is specific to the laptop in question and not something we can solve through code. But, if anyone knows if there is a solution that'd be great.
From the Startup Menu, press the F10 key to enter the BIOS setup utility. Click Advanced. Select Built-In Device Options. Select Graphics, and then select Discrete Graphics.
The easiest way from C++ to ensure that the dedicated graphics card is used instead of chipset switchable graphics under Windows is to export the following symbols (MSVC sample code):
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;
}
Caveat: If the user has created a profile for the application to use integrated chipset, then these will not work.
I am unsure if this would work similarly under Linux / MacOS (unlikely).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With