If you have GPUs from different vendors on the machine, it is easy to select which one to use with OpenGL.
In order to do so, call the following function before you create your OpenGL context:
// pass one of these to choose_ogl_vendor()
#define VENDOR_AMD "PCI\\VEN_1002&"
#define VENDOR_NVIDIA "PCI\\VEN_10DE&"
#define VENDOR_INTEL "PCI\\VEN_8086&"
void choose_ogl_vendor(const char *vendor_id)
{
int idx;
DISPLAY_DEVICEA dd;
HDC dc;
PIXELFORMATDESCRIPTOR pfd;
dd.cb = sizeof(dd);
idx = 0;
while (1) {
if (!EnumDisplayDevicesA(NULL, idx, &dd, 0))
return; // not found!
if (strstr(dd.DeviceID, vendor_id))
break; // there we go
idx += 1;
}
dc = CreateDCA(dd.DeviceName, NULL, NULL, NULL);
memset(&pfd, 0, sizeof(pfd));
pfd.nSize = sizeof(pfd);
pfd.nVersion = 1;
// those flags are not important, they just need to be valid (and nondemanding, just in case).
// later you will use whatever flags you wish when you are creating your actual gl context
pfd.dwFlags = PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_DOUBLEBUFFER|PFD_DEPTH_DONTCARE;
ChoosePixelFormat(dc, &pfd);
DeleteDC(dc);
}
This function will force opengl32.dll to load the ogl driver of your choice.
After that, proceed with the usual OpenGL context creation and initialization stuff.
Note, however, that once the GPU vendor's driver has been loaded, it can not be changed for the life time of your process.