| 124 | } |
| 125 | |
| 126 | void renderLayer(unsigned int layer, const std::vector<Primitive*>& primitives) { |
| 127 | glStencilFunc(GL_EQUAL, layer, 255); |
| 128 | glStencilOp(GL_INCR, GL_INCR, GL_INCR); |
| 129 | glStencilMask(255); |
| 130 | glEnable(GL_STENCIL_TEST); |
| 131 | |
| 132 | glEnable(GL_CULL_FACE); |
| 133 | for (std::vector<Primitive*>::const_iterator j = primitives.begin(); j != primitives.end(); ++j) { |
| 134 | glCullFace((*j)->getOperation() == Intersection ? GL_BACK : GL_FRONT); |
| 135 | (*j)->render(); |
| 136 | } |
| 137 | glDisable(GL_CULL_FACE); |
| 138 | } |
| 139 | |
| 140 | } // namespace OpenGL |
| 141 |
no test coverage detected