setFloatUniform method

bool setFloatUniform(
  1. String name,
  2. double val
)
  • set FLOAT

Implementation

bool setFloatUniform(String name, double val) {
  ffi.Pointer<ffi.Float> valT = calloc(ffi.sizeOf<ffi.Float>());
  valT.value = val;

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