win32, child windows, opengl
I have 4 child windows in an aplication, what I want is to do is use opengl with each window, I usually use one single window with a rendering context and a device context that make opengl draw to tha window, I use a double buffer so first I draw the scene and then I send it to the window with
I learned this from nehe.
Now is it posible to do this with some kind of handle to a device context of a child window or child windows can't have device contexts?. Or are you allowed to only have one device context in your window? I was thinking that maybe I could create diferent hDC like hDC1, hDC2... hDC4 and then draw what I want to display in child window one in the back buffer and use
SwapBuffers(hDC1), then draw the what has to be displayed in the second child window and use SwapBuffers(hDC2) for the next one... and so on.
Is this possible?..
Or its better if I just create one whindow and create 4 views with opengl instead of using separate child windows..?
Re: win32, child windows, opengl
You can do it either way. If you decide to use multiple rendering contexts, you just have to be certain to make the rendering context you want to draw in current before drawing. Then when you swap buffers you must swap the proper device context. There are also other details to be aware of when using multiple rendering contexts, e.g. sharing display lists.