Compatibility, when creating window from DLL

It turned out, that I didn’t see the actual problem. I assumed it was a problem with those legacy functions that this old library is using, but I was wrong. It was just that I haven’t set up the DisplayPort correctly (silly me). That was the reason why glClear seemed to work but content didn’t show.

I didn’t manage to find a better solution to the problem that I was losing access to the OpenGL-Plane that was initialized with wgl, so I’ve decided to use GLFW only to create the window and then create the OpenGL context for that window with wgl as well.

createExtWindow() {
  glfwInit();
  glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
  ExtWindow = glfwCreateWindow(600, 400, "Test View", NULL, NULL);
  HWND hWindow2 = glfwGetWin32Window(ExtWindow);
  // initialize OpenGL context using wgl
  ...
}

This solution worked for me to solve both issues. It’s probably not recommendable for new projects but I think it was the least effort to add a new feature to this old project.