GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


A Paste by Anonymous
1
 
glClearStencil(0x0);
glEnable(GL_STENCIL_TEST);
glColorMask(0, 0, 0, 0);
glStencilFunc(GL_ALWAYS, 0x1, 0x1);
glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
glBegin(GL_QUADS);
  glVertex3d(-0.6, 0.0, 0.0);
  glVertex3d(0.0, 0.6, 0.0);
  glVertex3d(0.6, 0.0, 0.0);
  glVertex3d(0.0, -0.6, 0.0);
glEnd();
glColorMask(1, 1, 1, 1);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
glStencilFunc(GL_EQUAL, 0x1, 0x1);
// ...draw...