getProgramInfoLog method

dynamic getProgramInfoLog(
  1. int program
)

Returns the information log for a program object

  • program pecifies the program object whose information log is to be queried.

Implementation

getProgramInfoLog(int program) {
  var infoLen = calloc<Int32>();

  gl.glGetProgramiv(program, INFO_LOG_LENGTH, infoLen);

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

  String message = '';

  if (infoLen.value > 0) {
    final infoLog = calloc<Int8>(_len);
    gl.glGetProgramInfoLog(program, _len, nullptr, infoLog);

    message = "\nError compiling shader:\n${infoLog.cast<Utf8>().toDartString()}";
    calloc.free(infoLog);
    return message;
  } else {
    return;
  }
}