glScissors corrupts other part of the window

In order to render an image only to a part of the window, I have used glScissors and have enabled the GL_SCISSORS_TEST.

I see that the other parts of the window is corrupted.
What might be the cause?

Have attached the snapshot of a sample application using glSciccors.
Thank you.

Maybe forgetting to disable it before your next call to glClear() ?

nope. i actually do not want that part of the window to be disturbed by any means.
in my original application we have UI placed there.

Anyways what i wanted is glAddSwapHintRectWIN.
I implemented the above API using the following code


// Get a pointer to the extension function.
typedef void (WINAPI *FNSWAPHINT)(GLint, GLint, GLsizei, GLsizei);
fnSwapHint = (FNSWAPHINT)wglGetProcAddress("glAddSwapHintRectWIN");

// Actual call to glAddSwapHintRectWIN.
if (fnSwapHint != NULL)
    (*fnSwapHint)(0, 0, 100, 100);

But now the problem is, we have we more child controls of the window placed in the view area. When i redraw the window, all the child controls disappear. Is there any way to avoid that. The clid controls are transparent. So i cannot have a specified rect to avoid.

Are you using GDI to render standard windows controls over opengl? Never mix GDI with opengl - it CAN be made to work with some hacks, but it is hardware/driver/OS specific.

Also, glAddSwapHintRectWIN doesn’t work with hardware accelerated opengl.

Yes. The application UI is developed using xaml framework.
If we need to have such window controls over the frame rendered by opengl, what is the suggested mechanism to handle it?