has anybody a short example of using OpenGL with Xlib, and drawing to a child window?
When I create just one window, OpenGL works fine, but if I create this Window and within another child-window, I am not able to draw to the child window using opengl?
You need to use either glXMakeCurrent or glXMakeContextCurrent to make the child window’s context current. And obviously use those functions to switch back to the main window’s context.