clearing the color buffer

I have a viewport(let’s say glViewPort(100,100,300,400)) that is smaller then the size of the context device(a window with 800 height,900 width). When I call glClear(GL_COLOR_BUFFER_BIT…), the entire context device is cleared; is there any possibility to specify to OGL to clear only the viewport zone?

Hi !

You can use glScissor() to set the area that glClear should have any effect on.