setFunc method

dynamic setFunc(
  1. int? depthFunc
)

Implementation

setFunc(int? depthFunc) {
  if (currentDepthFunc != depthFunc) {
    if (depthFunc != null) {
      switch (depthFunc) {
        case NeverDepth:
          gl.depthFunc(gl.NEVER);
          break;

        case AlwaysDepth:
          gl.depthFunc(gl.ALWAYS);
          break;

        case LessDepth:
          gl.depthFunc(gl.LESS);
          break;

        case LessEqualDepth:
          gl.depthFunc(gl.LEQUAL);
          break;

        case EqualDepth:
          gl.depthFunc(gl.EQUAL);
          break;

        case GreaterEqualDepth:
          gl.depthFunc(gl.GEQUAL);
          break;

        case GreaterDepth:
          gl.depthFunc(gl.GREATER);
          break;

        case NotEqualDepth:
          gl.depthFunc(gl.NOTEQUAL);
          break;

        default:
          gl.depthFunc(gl.LEQUAL);
      }
    } else {
      gl.depthFunc(gl.LEQUAL);
    }

    currentDepthFunc = depthFunc;
  }
}