My question is this, is there any way to get a rendering context to draw to some allocated memory without drawing it in a window?
Yes. Those off-screen areas are called Framebuffer Objects (FBO).
Also is there any way to get the frame buffer from that context. If so i would just call "glTexImage2D" and in the "bytes" argument have the pointer to the memory.
In fact using FBOs you can render directly to textures. You can then use the texture to draw to a regular window.
I recommend you do not use multiple OpenGL rendering threads. The main reason is, that the GPU is a shared resource and having multiple OpenGL contexts/threads access it concurrently impairs performance. Do the renderings in sequence. You can use a single, shared context for this.
Multiple OpenGL contexts can share their data objects (textures, vertex buffer objects, pixel buffer objects); the exact API used for this depends on the operating sytem through. On Windows you use wglShareLists
to make the connection. Abstract state carrier objects (FBOs, VAOs) can not be shared though; as a rule of thumb, everthing you can upload bulk data to, can be shared between contexts.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…