getOriginalPointer method

  1. @nonVirtual
Pointer<C> getOriginalPointer()

Implementation

@nonVirtual
Pointer<C> getOriginalPointer() {
  if (originalPointer == null) {
    if (!_requiresOriginalPointer) {
      throw StateError(
        '$structName.getOriginalPointer() was called on a value-type struct that never owns a pointer. '
        'This struct is meant to be passed by value via writeInto(), not by reference. '
        'If you need a pointer, use toC() to allocate one into Temp instead.'
      );
    } else {
      throw StateError(
        '$structName.getOriginalPointer() was called but originalPointer is null. '
        'This struct requires a raylib-owned pointer (e.g. from LoadShader, LoadModel, etc.) '
        'but none has been assigned yet or was already Unloaded. Make sure this struct '
        'was obtained via a Load* function and not constructed manually.'
      );
    }
  }
  return originalPointer!;
}