getShaderInfoLog method

String? getShaderInfoLog(
  1. WebGLShader shader
)

Implementation

String? getShaderInfoLog(WebGLShader shader){
  startCheck('getShaderInfoLog');
  final infoLen = calloc<Int32>();
  gl.glGetShaderiv(shader.id, 35716, infoLen);

  int _len = infoLen.value;
  calloc.free(infoLen);

  String message = '';
  if (_len > 1) {
    final infoLog = calloc<Int8>(_len);

    gl.glGetShaderInfoLog(shader.id, _len, nullptr, infoLog);
    checkError('getShaderInfoLog');
    message = "\nError compiling shader:\n${infoLog.cast<Utf8>().toDartString()}";
    calloc.free(infoLog);
    return message;
  }
  return null;
}