View Full Version : glScissors corrupts other part of the window
12-08-2009, 11:53 PM
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.
12-09-2009, 12:21 AM
Maybe forgetting to disable it before your next call to glClear() ?
12-09-2009, 02:37 AM
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.
12-09-2009, 05:37 AM
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.
12-09-2009, 09:22 PM
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?
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.