setCullFace method

dynamic setCullFace(
  1. int cullFace
)

Implementation

setCullFace(int cullFace) {
  if (cullFace != CullFaceNone) {
    enable(gl.CULL_FACE);

    if (cullFace != currentCullFace) {
      if (cullFace == CullFaceBack) {
        gl.cullFace(gl.BACK);
      } else if (cullFace == CullFaceFront) {
        gl.cullFace(gl.FRONT);
      } else {
        gl.cullFace(gl.FRONT_AND_BACK);
      }
    }
  } else {
    disable(gl.CULL_FACE);
  }

  currentCullFace = cullFace;
}