[ Previous | Next
| Table Of Contents

7.4 BOOL pglMakeCurrent(hab,hgc,hwnd)

BOOL pglMakeCurrent(hab,hgc,hwnd)

Description:

This call will bind an OpenGL hgc (context) to an OS/2 PM window. The pglMakeCurrent subroutine will replace the old current context (if there was one) with hgc. Before unbinding the old context, an implicit flush of the old context will take place. Thus subsequent OpenGL rendering commands will use hgc to modify hwnd. The first time hgc is made current to a window, its viewport will be initialized to the full size of hwnd. Subsequent calls to pglMakeCurrent with hgc will not affect its viewport. To unbind the current context without binding a new one, call pglMakeCurrent(hab,NULL,None). pglMakeCurrent returns True if successful, False otherwise.

Parameters:
HAB hab Handle anchor block 
HGC hgc Handle to OpenGL context 
HWND hwnd PM Window handle

Return Values:
True Context was successfully bound to the window 
False Error occurred.

Notes:

Only one context can be bound to a window at a time.

The PM window must have been created with window client class CS_SIZEREDRAW and CS_MOVENOTIFY

The application cannot WinSubclassWindow(hwnd) while an OpenGL context is bound to hwnd. 


[ Previous | Next | Table Of Contents ]