The function drawDisk renders a solid blue disk of radius r. The
function drawSquare renders a solid red square with sides of
length 2*r such that it tightly encloses the disk. What does the
following code render? What is in the stencil buffer after the
code has executed?
glClearStencil(0);
glClear(GL_STENCIL_BUFFER_BIT);
glEnable(GL_STENCIL_TEST);
glDisable(GL_DEPTH_TEST);
glStencilFunc(GL_ALWAYS, 0, 255);
glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
drawDisk();
glStencilFunc(GL_GEQUAL, 0, 255);
glStencilOp(GL_INCR, GL_DECR, GL_INCR);
drawSquare();