#include #include //for assert #include int main() { GLXContext glxContext = NULL, glxCopyContext = NULL; Display* display = XOpenDisplay(NULL); assert(display != NULL); int attribs[] = { GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, GLX_DOUBLEBUFFER, True, GLX_RENDER_TYPE, GLX_RGBA_BIT, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, None}; int nelems; GLXFBConfig* configs = glXChooseFBConfig(display, DefaultScreen(display), attribs, &nelems); assert(configs != NULL && nelems != 0); GLXFBConfig config = configs[0]; XFree(configs); glxContext = glXCreateNewContext(display, config, GLX_RGBA_TYPE, NULL, False); assert(glxContext != 0); glxCopyContext = glXCreateNewContext(display, config, GLX_RGBA_TYPE, NULL, False); assert(glxCopyContext != 0); glXCopyContext(display, glxContext, glxCopyContext, GL_ALL_ATTRIB_BITS); printf("Test finished.\n"); //cleanup if(display) { if(glxContext) glXDestroyContext(display, glxContext); if(glxCopyContext) glXDestroyContext(display, glxCopyContext); XCloseDisplay(display); } return 0; }