Scissor Test And Framebuffer Clearing: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
<source lang="c"> | <source lang="c"> | ||
glDisable(GL_SCISSOR_TEST); | glDisable(GL_SCISSOR_TEST); | ||
glClear(...); | // glClear(...); | ||
glEnable(GL_SCISSOR_TEST); | glEnable(GL_SCISSOR_TEST); | ||
</source> | </source> |
Latest revision as of 12:14, 3 January 2018
Why doesn't glClear() work for areas outside the scissor rectangle?
The OpenGL Specification states that glClear() only clears the scissor rectangle when the scissor test is enabled. If you want to clear the entire window, use the code:
glDisable(GL_SCISSOR_TEST);
// glClear(...);
glEnable(GL_SCISSOR_TEST);