Porting Rendering Contexts

The X Window System, Windows NT, and Windows 95 render through rendering contexts. Six GLX functions manage rendering contexts and five of them have an equivalent Win32 function.

The following table lists the GLX rendering functions and their equivalent Win32 functions.

GLX Rendering Context Function Win32 Rendering Context Function
GLXContext
glXCopyContext(Display *dpy,
GLXContext src,
GLXContext dst,
GLuint mask)
Not applicable.
GLXContext
glXCreateContext(Display *dpy,
XVisualInfo *vis,
GLXContext shareList,
Bool direct)
HGLRC wglCreateContext(HDC hdc)
void glXDeleteContext
(
Display *dpy,
GLXContext ctx)
BOOL wglDeleteContext(HGLRC hglrc)
GLXContext glXGetCurrentContext
(
void)
HGLRC wglGetCurrentContext(VOID)
GLXDrawable glXGetCurrentDrawable(void) HDC wglGetCurrentDC(VOID)
Bool
glXMakeCurrent(Display *dpy,
GLXDrawable draw,
GLXContext ctx)
BOOL wglMakeCurrent(HDC hdc,
HGLRC hglrc)

Return types and other types have different names in the X Window System than in Windows NT and Windows 95. You can search for occurrences of GLXContext to help find parts of your code that need to be ported.

The following sections compare rendering context code samples in an X Window System program and the same code after it has been ported to Windows NT and Windows 95.

For more information on rendering contexts, see Rendering Contexts.