sdlRenderTexture function

bool sdlRenderTexture(
  1. Pointer<SdlRenderer> renderer,
  2. Pointer<SdlTexture> texture,
  3. Pointer<SdlFRect> srcrect,
  4. Pointer<SdlFRect> dstrect,
)

Copy a portion of the texture to the current rendering target at subpixel precision.

\param renderer the renderer which should copy parts of a texture. \param texture the source texture. \param srcrect a pointer to the source rectangle, or NULL for the entire texture. \param dstrect a pointer to the destination rectangle, or NULL for the entire rendering target. \returns true on success or false on failure; call SDL_GetError() for more information.

\threadsafety This function should only be called on the main thread.

\since This function is available since SDL 3.1.3.

\sa SDL_RenderTextureRotated \sa SDL_RenderTextureTiled

extern SDL_DECLSPEC bool SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect)

Implementation

bool sdlRenderTexture(
    Pointer<SdlRenderer> renderer,
    Pointer<SdlTexture> texture,
    Pointer<SdlFRect> srcrect,
    Pointer<SdlFRect> dstrect) {
  final sdlRenderTextureLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlRenderer> renderer, Pointer<SdlTexture> texture,
          Pointer<SdlFRect> srcrect, Pointer<SdlFRect> dstrect),
      int Function(
          Pointer<SdlRenderer> renderer,
          Pointer<SdlTexture> texture,
          Pointer<SdlFRect> srcrect,
          Pointer<SdlFRect> dstrect)>('SDL_RenderTexture');
  return sdlRenderTextureLookupFunction(renderer, texture, srcrect, dstrect) ==
      1;
}