Raylib constructor

Raylib({
  1. required String core,
  2. String? gui,
  3. RaylibTempOptions? tempOptions,
  4. Random? random,
})

Implementation

Raylib({
  required String core,
  String? gui,
  RaylibTempOptions? tempOptions,
  Random? random,
}) {
  _dynCore = .open(core);
  _dynGui = gui != null ? .open(gui) : null;
  this.tempOptions = tempOptions ?? .new();
  this.random = random ?? .new();

  if (_instance != null) {
    throw StateError("There can only be one instance of a $runtimeType!");
  }

  if (this.tempOptions.stringCount < 4) {
    throw StateError("Raylib expects at least 4 preallocated String slots, got ${this.tempOptions.stringCount}");
  }

  _instance = this;

  _init();
}