A small set of calls integrates OpenGL into whatever windowing system it is running in. Since these calls are windowing-system specific, they cannot be the same across all platforms. In OS/2, these calls make up the PGL (Presentation Manager GL) specification. Application programmers use the PGL interface to:

PGL provides much of the same functionality as glX in X Windows systems, and the WGL interface in Microsoft systems.

OpenGL contexts are created using pglCreateContext. One parameter to this call is a VISUALCONFIG, which describes what type of ancillary buffers are needed to go with the rendering context. A list of available VISUALCONFIGs can be queried with pglQueryConfigs. When choosing a VISUALCONFIG, you should look for one which contains just the buffers you plan on using. For instance, choose a VISUALCONFIG with accumulation buffers only if you plan to use them. 64-bits deep accumulation buffers allocated for a 400 by 400 window would allocate 1,280,000 bytes! Therefore, you should choose the visual configuration with the least number of buffers to suit your needs in order to minimize the number of buffers allocated. After a context is created, it must be bound to an OS/2 window by calling pglMakeCurrent When a context is current, that means it can finally be used for rendering.

OpenGL runs as a set of DLLs on top of OS/2:


[Back: OpenGL Functionality]
[Next: OpenGL Windowing and Input Toolkits]