It’s working perfectly fine and all the child windows seamlessly become one with the main window. All the child windows are created with no decoration. However, the problem is that when rendering, nothing appears. I’m setting the context using glfwMakeContextCurrent(child) just before rendering on the child window but nothing appears.
After searching on google I even tried this:
glfwMakeContextCurrent( window );
auto hglrc = glfwGetWGLContext(window);
auto current_dc = wglGetCurrentDC();
still no luck!!! If I don’t use the SetParent call then everything renders perfectly but that’s not the purpose. I would appreciate if someone point out the correct way to do it.
I don’t know enough about child windows and OpenGL since when I’ve needed this behaviour I’ve simply closed the second window and rendered the window content to a region of the main window directly - this is also how the popular Dear ImGui docking branch works.
I did find a bit of code on Github using GLFW and SetParent, which I can’t find again (sorry). However it appeared to be resting some style attributes similar to the post below: