// 坐标点(x, y ,w, h)为以左上角为原点的原始坐标。// w、h,即为显示区域(view)的宽和高。// windowW, windowH,表示屏幕的宽和高。int scissorX = x;
int scissorY = windowH - ( y + h);
int scissorW = w;
int scissorH = h;
例子:清空指定区域颜色及深度
void clearBuffer(int x, int y, int w, int h)
{
glEnable(GL_SCISSOR_TEST);
glScissor(x, y, w, h);
glClearColor(0.0, 0.0, 0.0. 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDisable(GL_SCISSOR_TEST);
}