2 windows

i have a scene that i want displayed in 2 different windows. they r the same scene but at different angles. do i need to create a new DC/RC? could someone plz help. some sample code will be of great help.Thank u

As far as I know: Yes. You need a two contextes (?) for two windows.

You can render two (or more) different views to two parts of the same window with the glViewport command, but if you definitely want two separate windows, eror is right… each one will have its own OpenGL Render Context.

If you do use more than one context and you want to render the same scene between the two, use wglShareLists (assuming you are using MS Windows platform) to make sure the display lists, and texture objects are shared between the two (or more) contexts.

Hope that helps.

thanx guyz. i have another question. will i need to have a separate display routine now for the new RC? is it possible to use the same display routine so that i can check to see if atleast the 2 contexts are alive. some sample code will be helpful.

thank u

You can use the same display routine as long as you make the RC for the specific window current before calling (or at the beginning of) your display routine.

wglMakeCurrent( HDC hWindowDC, HGLRC hWindowRC )

The rest of the OpenGL commands in your display routine should then apply to whichever window you wanted the rendering to be displayed in.