sdlLoadObject function

Pointer<NativeType> sdlLoadObject(
  1. String? sofile
)

Dynamically load a shared object.

\param sofile a system-dependent name of the object file \returns an opaque pointer to the object handle or NULL if there was an error; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.0.

\sa SDL_LoadFunction \sa SDL_UnloadObject

extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile)

Implementation

Pointer<NativeType> sdlLoadObject(String? sofile) {
  final sdlLoadObjectLookupFunction = libSdl2.lookupFunction<
      Pointer<NativeType> Function(Pointer<Utf8> sofile),
      Pointer<NativeType> Function(Pointer<Utf8> sofile)>('SDL_LoadObject');
  final sofilePointer = sofile != null ? sofile.toNativeUtf8() : nullptr;
  final result = sdlLoadObjectLookupFunction(sofilePointer);
  calloc.free(sofilePointer);
  return result;
}