A pixel format specifies several properties of an OpenGL drawing surface. Some of the properties specified by a pixel format are:
Microsoft's implementation of OpenGL for Windows NT and Windows 95 uses the PIXELFORMATDESCRIPTOR data structure to convey pixel format data. The structure's members specify the preceding properties and several others.
A given device context can support several pixel formats. Windows NT and Windows 95 identify the pixel formats that a device context supports with consecutive one-based index values (1, 2, 3, 4, and so on). A device context can have just one current pixel format, chosen from the set of pixel formats it supports.
Each window has its own current pixel format in OpenGL in Windows NT and Windows 95. This means, for example, that an application can simultaneously display RGBA and color-index OpenGL windows, or single- and double-buffered OpenGL windows. This per-window pixel format capability is limited to OpenGL windows.
Typically, you obtain a device context, set the device context's pixel format, and then create an OpenGL rendering context suitable for that device.
Note You set the pixel format before creating a rendering context because the rendering context inherits the device context's pixel format.