[ Previous | Next
| Table Of Contents

7.3 HGC pglCreateContext(hab,pVisualConfig,ShareList,IsDirect)

HGC pglCreateContext(hab,pVisualConfig,ShareList,IsDirect)

Description:

This call will create an OpenGL context using the given visual config. A visual config specifies what framebuffer resources are available to the rendering context. If an OpenGL context was successfully created, a handle to it will be returned, else NULL will be returned.

Parameters:
HAB hab Handle to anchor block 
PVISUALCONFIG pVisualConfig Pointer to VISUALCONFIG structure containing desired buffer config 
HGC ShareList Handle of OpenGL context with which to share display lists within a process. 
BOOL IsDirect TRUE: Bypass GPI, and render to a PM window. Generally faster.

FALSE: This context will use Gpi for OpenGL rendering, using GpiBitBlt to blit OpenGL rendering to a PM window (slower)

Return Values:
HGC Handle to successfully created context 
NULL Error occurred.

Notes:

Visual Configurations can be listed through pglQueryConfigs() and chosen by using the call pglChooseConfig()

Direct context- bypasses PM when displaying OpenGL rendering. Not available on all OS/2 configurations. If IsDirect parameter is TRUE, but a direct con- text is not available, an indirect context will be created. pglIsIndirect can be called to see if an OpenGL context is direct or indirect.

Indirect context - uses GpiBitBlt to get image to screen . Allows access to a PM bitmap containing OpenGL rendered image. The PM Bitmap is not guaranteed to contain any OpenGL rendering until the OpenGL graphics pipeline has been flushed (glFlush , pglSwapBuffers or pglWaitGL).

If ShareList is not NULL, then all display list definitions are shared by ShareList and the newly created context. An arbitrary number of contexts can share display lists, but each context must be owned by the same process. 


[ Previous | Next | Table Of Contents ]