allocate method
void
allocate(
- RaylibTemp<
RaylibBase> temp, - MemoryPointer<
RType> p, - String key, {
- int count = 1,
- bool raw = false,
override
Allocates any backing storage for a value at p, using temp and
identified by key. count and raw are for codecs that allocate
arrays or need unmanaged memory.
No-op by default: most codecs (scalar, enum, struct) don't own pointers, so there's nothing to allocate.
Implementation
@override
void allocate(RaylibTemp temp, MemoryPointer p, String key, {int count = 1, bool raw = false}) {
for (var i = 0; i < count; i++) {
for (var j = 0; j < this.count; j++) {
inner.allocate(temp,
p.offsetBy((i * this.count + j) * inner.type.byteSize),
'${key}_${i}_$j',
count: 1,
raw: raw,
);
}
}
}