#include #include #include #include #define WINDSIZEX 100 #define WINDSIZEY 100 #define SIZEX 4 #define SIZEY 1 void init(void) { int i; GLfloat white[] = {1.0, 1.0, 1.0, 1.0}; glClearColor(0.0, 0.0, 0.0, 1.0); glColor4fv(white); glDisable(GL_DITHER); } static void test(void) { GLint val; glClear(GL_COLOR_BUFFER_BIT); glStencilFuncSeparate(GL_FRONT, GL_LEQUAL, 12, 0xf); glStencilFuncSeparate(GL_BACK, GL_GEQUAL, 13, 0xe); glGetIntegerv(GL_STENCIL_BACK_FUNC, &val); if (val != GL_GEQUAL) { printf("glStencilFuncSeparate not correct\n"); } } void display(void) { glViewport(0, 0, WINDSIZEX, WINDSIZEY); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0, WINDSIZEX, 0, WINDSIZEY); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); test(); } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_STENCIL); glutInitWindowSize(WINDSIZEX, WINDSIZEY); glutInitWindowPosition(100, 100); glutCreateWindow(argv[0]); init(); glutDisplayFunc(display); glutMainLoop(); return 0; }