No, it’s a global setting that has nothing to do with OpenGL/DirectX
By default, Windows will try to automatically choose which GPU to use if you have more than one, the most common example is a laptop like yours with an Intel processor that has an integrated GPU along with a dedicated Nvidia GPU. It does a poor job of managing it so you should get better performance by setting it to only use the Nvidia GPU. The battery will drain faster, but it’s necessary for the best performance.