I need to show several views of a model in the same window. I originally used several glControls, but then I decided to use only one glControl and render to different viewports. However, the thing does not work...
I call the following code 4 times from the Paint event of the glControl:
GL.Viewport(region); // "region" is a Rectangle that represents the corresponding region on the screen GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); // Set projection and modelview matrices // Draw my model control.SwapBuffers();
After this code runs, only the last drawn region is correctly displayed, the others are empty. I found out that when I call GL.Clear(ClearBufferMask.ColorBufferBit), the whole glControl is cleared instead of clearing only the region set by GL.Viewport(). How do I fix this?