setMat2Uniform method

bool setMat2Uniform(
  1. String name,
  2. List<double> val
)
  • set MAT2

Implementation

bool setMat2Uniform(String name, List<double> val) {
  ffi.Pointer<ffi.Float> valT = calloc(ffi.sizeOf<ffi.Float>() * 4);
  valT[0] = val[0];
  valT[1] = val[1];
  valT[2] = val[2];
  valT[3] = val[3];

  int ret = _setUniform(
    name.toNativeUtf8().cast<ffi.Char>(),
    valT.cast<ffi.Void>(),
  );
  calloc.free(valT);
  return ret == 0 ? false : true;
}