Apologies if this isn't the correct place to post but I came across one of casey's blog posts about multi-window applications with opengl:
I'm currently trying to implement opengl rendering that needs to target multiple windows. I've tried to use the functions mentioned in the blog:
CGLuint wglAcquireDCFramebuffer(HDC hDC); void wglReleaseDCFramebuffer(HDC hDC, CGLuint framebuffer);
But can't find documentation anywhere and the functions don't seem to exist in the windows opengl extension string. I'm guessing this was more of a suggestion on how this problem could be fixed rather than a how to on how to go about this? With that in mind and with the assumption the previously mentioned functions aren't available, I was wondering if anyone has any insight on how best to approach this? My initial idea was as follows:
* Create a single opengl context through a "primary" window.
* Create a render target texture large enough to include all back buffers of the created windows.
* Render all window graphics in a single pass to the all encompassing render target.
* For each window, copy the appropriate regions of the large render target to the window's back buffer and display.
Now this might be a stupid idea/not even possible, but my main motivation was to try and reduce the number of wglMakeCurrent calls and to reduce the number of contexts I need to create at start up and use throughout the app. It was my understanding that switching between contexts could be expensive, hence the want to reduce the number of contexts as much as possible.
Any info/advice/tips on the subject would be greatly appreciated.