Multiple Rendering Contexts

Hi,

I am tring to use OpenGL in .NET. Every thing seems to work except for one thing. I am trying to render to a number of windows.

All seems to work except each window of course has its own Buffer, etc but I can’t find how to select one.

I setup Window one and do some drawing. Render the scene and swap the buffers. All works. When I try to draw to one of the other windows however things go bad. The OpenGL Pipeline seems to use the first windows Back Buffer to do all the drawing no matter which window I wish to draw to.

How can I direct my Drawing commands to the right buffer.

Sorry there is no source code, it is way to large to be pasted here.

Thanks for any help
Danny

I haven’t tried OpenGL programming with .net yet.

What part of your .net implementation is supposed to be selecting the window’s OpenGL rendering context when you switch windows?

I mean what is the .net equivalent of wglMakeCurrent( hRC ) for each window before you draw to it? Have you checked that part in a debugger to make sure the rendering context is unique for each window and that it is being made current before drawing?

Thanks for the reply.

wglMakeCurrent(hRC) is the same on .NET I just wasn’t using it. As soon as I added the code needed to make the neccessary window current everything worked.

I now have a problem with resize the window. After a resize I update the ViewPort and Perspective but the glClear(GL_COLOR_BUFFER_BIT); function does not clear the whole window, and the window is clipped to the orginal size.

Thanks for the help robosport
Danny

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.