structAllocateInto method

  1. @override
void structAllocateInto(
  1. RaylibTemp temp,
  2. WasmStructPointer<WaveD> p,
  3. String key
)
override

Allocates nested pointers into temp under key as needed.

Implementation

@override
void structAllocateInto(RaylibTemp temp, WasmStructPointer<WaveD> p, String key) {
  if (data.lengthInBytes > 0) _dataPtr = switch (sampleSize) {
   8  => temp.Uint8$.Array(data.asUint8List(), key: '${key}_data').address,
   16 => temp.Int16$.Array(data.asInt16List(), key: '${key}_data').address,
   32 => temp.Float32$.Array(data.asFloat32List(), key: '${key}_data').address,
    _  => throw UnsupportedError('Unexpected sampleSize: $sampleSize'),
  };
}