SDL_LoadObject(3)

✨ SDL_LoadObject(3) ✨

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today we're talking about SDL_LoadObject β€” aka the girl whose entire job is dynamically loading a shared object. that's it. that's the gig. she's a loader. she's the loader. πŸ’…


🌸 NAME 🌸

SDL_LoadObject β€” Dynamically load a shared object.

like, at runtime. on purpose. because you asked. πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_loadso.h>

SDL_SharedObject * SDL_LoadObject(const char *sofile);

πŸ’– FUNCTION PARAMETERS πŸ’–

  • sofile β€” the name of the object file, and it's system-dependent, meaning don't come at me with one universal path string, bestie, different platforms do their own thing. 🌈

⭐ RETURN VALUE ⭐

she hands you back an opaque pointer to the object handle β€” that's your lil trophy, your golden ticket πŸ†

but if it fails? you get NULL. no handle, no trophy, nothing. and when that happens you gotta call SDL_GetError() for more information, because she's not gonna explain herself unprompted. 😭


🧚 THREAD SAFETY 🧚

fr fr, it is safe to call this function from any thread. no drama, no locks you have to worry about, just go. πŸ‘‘


πŸ”₯ AVAILABILITY πŸ”₯

this function is available since SDL 3.2.0. if you're on anything older, sorry babe, she doesn't exist yet. πŸ’€


πŸ’œ SEE ALSO πŸ’œ


ngl the vibe check here is: load it, grab the handle, go find your symbols, and for the love of everything don't forget to unload it. leaks are not the moment. πŸ™ˆ

Simple Directmedia Layer ✿ SDL 3.4.18 ✿ SDL_LoadObject(3)

mwah, that's the whole page, ily, go write some portable code πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from