Porting Rendering Contexts
The X Window System and Windows render through rendering contexts. Six GLX functions manage rendering contexts and five of them have an equivalent Windows function.
The following table lists the GLX rendering functions and their equivalent Windows functions.
|GLX rendering context function||Windows rendering context function|
|GLXContextglXCopyContext( Display *dpy,GLXContext src,GLXContext dst,GLuint mask)||Not applicable.|
|GLXContextglXCreateContext( 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)|
|BoolglXMakeCurrent( 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. 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.
For more information on rendering contexts, see Rendering Contexts.
Build date: 3/6/2012