
380 IV Performance
typedef struct _GPU_DEVICE
{
DWORD cb;
CHAR DeviceName[32];
CHAR DeviceString[128];
DWORD Flags ; //
RECT rcVirtualScreen;
} GPU_DEVICE , *PGPU_DEVICE;
Listing 27.1. GPU DEVICE structure.
F inally, the affinity-DC is created with wglCreateAffinityDCNV:
HDC wglCreateAffinityDCNV(const HGPUNV * phGpuList)
The GPU handles that were retrieved earlier are passed into a NULL-terminated
array in phGpuList. An OpenGL context can be created with this affinity DC using
wglCreateContext, and rendering will now be restricted to the GPUs specified in
phGpuList.
Listing 27.2 shows the affinity DC creation, which corresponds to the scenario
in Figure 27.3