sdlNetInit function

int sdlNetInit()

Initialize SDL_net.

You must successfully call this function before it is safe to call any other function in this library, with one exception: a human-readable error message can be retrieved from SDLNet_GetError() if this function fails.

SDL must be initialized before calls to functions in this library, because this library uses utility functions from the SDL library.

It is safe to call this more than once; the library keeps a counter of init calls, and decrements it on each call to SDLNet_Quit, so you must pair your init and quit calls.

\returns 0 on success, -1 on error.

\since This function is available since SDL_net 2.0.0.

extern DECLSPEC int SDLCALL SDLNet_Init(void)

Implementation

int sdlNetInit() {
  final sdlNetInitLookupFunction = libSdl2Net
      .lookupFunction<Int32 Function(), int Function()>('SDLNet_Init');
  return sdlNetInitLookupFunction();
}