Translating the GLX Library
OpenGL X Window System programs use the OpenGL Extension with the X Window System (GLX) library. The library is a set of functions and routines that initialize the pixel format, control rendering, and perform other OpenGL specific tasks. It connects the OpenGL library to the X Window System by managing window handles and rendering contexts. You must translate these functions to their equivalent Windows functions. The following table lists the X Window System GLX functions and their equivalent Windows functions.
GLX/Xlib function | Windows function |
---|---|
glXChooseVisual | ChoosePixelFormat |
glXCopyContext | wglCopyContext |
glXCreateContext | wglCreateContext |
glXCreateGLXPixmap | CreateDIBitmapCreateDIBSection |
glXDestroyContext | wglDeleteContext |
glXDestroyGLXPixmap | DeleteObject |
glXGetConfig | DescribePixelFormat |
glXGetCurrentContext | wglGetCurrentContext |
glXGetCurrentDrawable | wglGetCurrentDC |
glXIsDirect | Not applicable. |
glXMakeCurrent | wglMakeCurrent |
glXQueryExtension | GetVersion |
glXQueryVersion | GetVersion |
glXSwapBuffers | SwapBuffers |
glXUseXFont | wglUseFontBitmaps |
XGetVisualInfo | GetPixelFormat |
XCreateWindow | CreateWindow, CreateWindowEx, GetDC, BeginPaint |
XSync | GdiFlush |
Not applicable. | SetPixelFormat |
Some GLX functions don't have an equivalent Windows function. To port these functions to Windows, rewrite your code to achieve the same functionality. For example, glXWaitGL has no equivalent Windows function but you can achieve the same result, executing any pending OpenGL commands, by calling glFinish.
The following topics describe how to port GLX functions that set the pixel format, and manage rendering contexts, pixmaps and bitmaps.
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