???????????????????????????Щ?????????·????
?????????????????????????????????????????????????RGBA????????
???????????????洢????????????????????????????????????????????????????????б????????????Щ?????????????滻????????????С?
??????建????????????????????????????????????????????????????????????????????滻????????????У?????????????δ??????????浽??????????У????????????????
??????????????????????????????????????????????????????????????????????ο??????????????????????????ò????????????????????????????????????????????????
??????????
????????????д?????建?????????????У????????????洢????建?????????????ο?????б???glStencilFunc???????????????????建???????????????????glStencilOp
????void glStencilFunc (GLenum func?? GLint ref?? GLuint mask);
????func??GL_NEVER ???????????
????GL_ALWAYS ????????????????)
????GL_LESS С??ο?????????
????GL_LEQUAL С??????????????
????GL_EQUAL ???????
????GL_GEQUAL ??????????
????GL_GREATER ???????
????GL_NOTEQUAL ?????????
????ref: ?ο??
????mask:????????????????????Щ????1??λ????С????????????????????
??????????glStencilFunc (GL_LESS?? 1.0?? 1.0);??建???????????????????С??1.0?????????????
????void glStencilOp (GLenum fail?? GLenum zfail?? GLenum zpass);
????fail??????δ????????α仯??zfail??????????????????????δ????????α仯??zpass???????????????????δ??????????????????α仯
????GL_KEEP??????????????????
????GL_ZERO??????
????GL_REPLACE????ò????????е??趨??????浱???????
????GL_INCR??????1?????????????????????????
????GL_INCR_WRAP??????1?????????????????????????????
????GL_DECR??????1???????????????????????
????GL_DECR_WRAP??????1??????????????????????????????
????GL_INVERT????λ?????
????δ??????建????
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0?? 0?? -20);
glColor3f(1.0f??1.0f??1.0f);
dRadius = 5.0*(sqrt(2.0)/2.0);
glBegin(GL_LINE_STRIP);
for (dAngel=0;dAngel<380.0;dAngel+=0.1)
{
glVertex2d(dRadius*cos(dAngel)??dRadius*sin(dAngel));
dRadius*=1.003;
}
glEnd();
glColor3f(1.0f??0.0f??0.0f);
glRectf(-5??-5??5??5);