Hi,
I’m making a program with a hot-reloading system, where most of the code is compiled to a DLL and the EXE reloads it whenever a change is made. I’m initializing the window in the EXE and trying to sharing the context with the DLL so that the DLL can draw to it with opengl functions, but I’m running into issues with GLAD loading function pointers…
I’m using these lines within the DLL to attempt to load function pointers:
// game_memory is passed to the DLL and game_memory->window is a GLFWwindow * set in the EXE after window initialization
glfwMakeContextCurrent(game_memory->window);
gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)
This exact same code works just fine in the EXE, and I’ve been able to draw triangles, use shaders, etc. But when I use it in the DLL it fails, and I don’t understand why. Is context not allowed to be shared between an EXE and DLL? Or is there something else going on?