Well, I have my basic library code working now, but getting it to run in the context of my application has led to new issues.
Basically, I'm writing an AI for a game that provides a JavaAI interface. The interface calls the AI to update its state through a number of different events starting with init(), and all of my drawing code runs during update(). The AI only sort-of has an interface for debugging, but it uses images as a form of database with GL as an accelerator for writing to it.
The problem is that since it's called from events (even though there's only one thread), the GL context created during init is not reachable from update. I tried unbinding the context at the end of init via glfwMakeContextCurrent(NULL);
to make it available later, but for whatever reason that causes the game to crash. I also tried setting
glfwWindowHint(GLFW_CONTEXT_RELEASE_BEHAVIOR, GLFW_RELEASE_BEHAVIOR_NONE);
but that didn't stop it from crashing.
I'm not sure what to do since there are a lot of restrictions and the usual method of handling this sort of thing has failed.