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.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for