As far as I know, there is no cross-platform way to create contexts, you will need to create your own abstraction and then implement it for each platform.
In the windows, I used the following code to create a second context for loading content in the background thread (this program used GLFW, but it did not matter):
void Program::someFunction() { HDC hdc = wglGetCurrentDC(); HGLRC hglrc = wglGetCurrentContext(); HGLRC hglrc_new = wglCreateContext(hdc); wglShareLists(hglrc, hglrc_new); loadThread = boost::thread(&Program::loadFunc, this, hdc, hglrc_new); } void Program::loadFunc(HDC hdc, HGLRC hglrc) { wglMakeCurrent(hdc, hglrc);
source share