MDI Views with OpenGL

I’ve seen this question asked a few times, but, with no definitive answer. Does anyone know how to manage OpenGL in an MDI application that has a dynamic splitter? I have it set up so that each view in the splitter has its own RC, and, I call wglMakeCurrent BEFORE drawing (in OnDraw). Yet, OpenGL does not always update the view(s). It appears to be tied to the view that is “active”. Any ideas?


I think that msdn is the only place to have information about stuff like that. A wild guess would be to have only one RC if that is possible.

Thanks for the reply. I tried using one RC (in the CDocument class) with no luck. Each view will update only if it is the currently active view. Someone else suggested a separate display list for each view. I use a global display llist. Is this a problem?

I do not use it so I really do not know.
I did a search for mdi in the forum :
says that you can not share display lists across rendering contexts.

I suggest that you do a better search in both forum and if no luck post in the advanced forum.

Thanks to everyone who offered help. I have resolved this problem. The application is a COM based program. Within one of the interfaces that writes to the screen, the code was grabbing the “active” view. This was the only OpenGL view that was being updated. It made it appear that the rendering context was invalid, when, in fact the code was doing what it was told to do. To get around it, I moved the screen wriing code from the interface to the view. This resolved the problem.