How to create an OpenGL context using a specific graphics driver?

Some computers have several video cards / chipsets installed, even if (for example, for laptops) they have no more than one monitor.

I'm having problems with a laptop system that is equipped with Intel and Nvidia graphics hardware. Intel drivers are known to be terrible at supporting OpenGL, and my code works with an unexplained rendering error, since when creating the rendering context, it seems that the default system is Intel, not Nvidia.

Is there a way to prevent this from starting? To say something like "polling for all available graphics drivers, avoid Intel drivers, if possible, and give me an OpenGL rendering context with a driver that will work"?

+5
source share
1 answer

There is no portable way to do what you ask, but this document describes how to get "high-performance graphics rendering" to use systems with NVIDIA Optimus technology:

http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf

In particular, refer to the section "Global variable NvOptimusEnablement (new in the driver) Release 302), which says:

Release 302, Optimus , - , . NvOptimusEnablement. . LSB DWORD . 0x00000001 . 0x00000000 , .

:

extern "C" {
    _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
}

- WGL_nv_gpu_affinity, WGL , , Intel/NVIDIA:

http://developer.download.nvidia.com/opengl/specs/WGL_nv_gpu_affinity.txt
+1

All Articles