Function SDL_LoadFunction

pub unsafe extern "C" fn SDL_LoadFunction(
    handle: *mut SDL_SharedObject,
    name: *const i8,
) -> Option<unsafe extern "C" fn()> 
Available on crate feature dep_sdl3 only.
Expand description

Look up the address of the named function in a shared object.

This function pointer is no longer valid after calling SDL_UnloadObject().

This function can only look up C function names. Other languages may have name mangling and intrinsic language support that varies from compiler to compiler.

Make sure you declare your function pointers with the same calling convention as the actual library function. Your code will crash mysteriously if you do not do this.

If the requested function doesn’t exist, NULL is returned.

§Parameters

  • handle: a valid shared object handle returned by SDL_LoadObject().
  • name: the name of the function to look up.

§Return value

Returns a pointer to the function or NULL on failure; call SDL_GetError() for more information.

§Thread safety

It is safe to call this function from any thread.

§Availability

This function is available since SDL 3.2.0.

§See also