sdlNetInit function

bool sdlNetInit()

Initialize the SDL_net library.

This must be successfully called once before (almost) any other SDL_net function can be used.

It is safe to call this multiple times; the library will only initialize once, and won't deinitialize until SDLNet_Quit() has been called a matching number of times. Extra attempts to init report success.

\returns true on success, false on error; call SDL_GetError() for details.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL_net 3.0.0.

\sa SDLNet_Quit

extern SDL_DECLSPEC bool SDLCALL SDLNet_Init(void)

Implementation

bool sdlNetInit() {
  final sdlNetInitLookupFunction = libSdl3Net
      .lookupFunction<Uint8 Function(), int Function()>('SDLNet_Init');
  return sdlNetInitLookupFunction() == 1;
}