sdlLoadTextureIo function render

Pointer<SdlTexture> sdlLoadTextureIo(
  1. Pointer<SdlRenderer> renderer,
  2. Pointer<SdlIoStream> src,
  3. bool closeio
)

Load a BMP, PNG or JPEG image from a seekable SDL data stream.

The new texture should be freed with SDL_DestroyTexture(). Not doing so will result in a memory leak.

\param renderer the renderer to use. \param src the data stream for the texture. \param closeio if true, calls SDL_CloseIO() on src before returning, even in the case of an error. \returns a pointer to a new SDL_Texture structure or NULL on failure; call SDL_GetError() for more information.

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

\since This function is available since SDL 3.6.0.

\sa SDL_DestroyTexture \sa SDL_LoadTexture

extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_LoadTexture_IO(SDL_Renderer *renderer, SDL_IOStream *src, bool closeio)

See also:

Implementation

Pointer<SdlTexture> sdlLoadTextureIo(
  Pointer<SdlRenderer> renderer,
  Pointer<SdlIoStream> src,
  bool closeio,
) {
  final sdlLoadTextureIoLookupFunction = _libSdl
      .lookupFunction<
        Pointer<SdlTexture> Function(
          Pointer<SdlRenderer> renderer,
          Pointer<SdlIoStream> src,
          Bool closeio,
        ),
        Pointer<SdlTexture> Function(
          Pointer<SdlRenderer> renderer,
          Pointer<SdlIoStream> src,
          bool closeio,
        )
      >('SDL_LoadTexture_IO');
  return sdlLoadTextureIoLookupFunction(renderer, src, closeio);
}