toC method

  1. @nonVirtual
Pointer<C> toC(
  1. RaylibTemp temp,
  2. String key
)

Implementation

@nonVirtual
Pointer<C> toC(RaylibTemp temp, String key) {
  String baseKey = _getBaseKey(key);

  if (!_requiresOriginalPointer) {
    final p = allocatePointer(temp, baseKey);
    allocateInto(temp, p, baseKey);
    return p;
  }

  if (_internalId == -1) _internalId = ++_internalIdCounter;
  if (!isDisposed) _warnIfNoOriginalPointer(temp);

  baseKey = _getBaseKeyWithId(key);

  if (originalPointer != null) {
    temp.debugSyncInfo('[SYNC] $structName.syncInto($baseKey)');
    if (isDisposed) return originalPointer!;
    if (!temp.doSync) return originalPointer!;

    syncInto(temp, originalPointer!, baseKey);
    return originalPointer!;
  }

  temp.debugSyncInfo('[SYNC] $structName.allocatePointer($baseKey)');
  _allocKey = baseKey;
  final p = allocatePointer(temp, baseKey);
  allocateInto(temp, p, baseKey);
  originalPointer = p;
  return originalPointer!;
}