sdlRenderTexture9GridTiled function render

bool sdlRenderTexture9GridTiled(
  1. Pointer<SdlRenderer> renderer,
  2. Pointer<SdlTexture> texture,
  3. Pointer<SdlFRect> srcrect,
  4. double leftWidth,
  5. double rightWidth,
  6. double topHeight,
  7. double bottomHeight,
  8. double scale,
  9. Pointer<SdlFRect> dstrect,
  10. double tileScale,
)

Perform a scaled copy using the 9-grid algorithm to the current rendering target at subpixel precision.

The pixels in the texture are split into a 3x3 grid, using the different corner sizes for each corner, and the sides and center making up the remaining pixels. The corners are then scaled using scale and fit into the corners of the destination rectangle. The sides and center are then tiled into place to cover the remaining destination rectangle.

\param renderer the renderer which should copy parts of a texture. \param texture the source texture. \param srcrect the SDL_Rect structure representing the rectangle to be used for the 9-grid, or NULL to use the entire texture. \param left_width the width, in pixels, of the left corners in srcrect. \param right_width the width, in pixels, of the right corners in srcrect. \param top_height the height, in pixels, of the top corners in srcrect. \param bottom_height the height, in pixels, of the bottom corners in srcrect. \param scale the scale used to transform the corner of srcrect into the corner of dstrect, or 0.0f for an unscaled copy. \param dstrect a pointer to the destination rectangle, or NULL for the entire rendering target. \param tileScale the scale used to transform the borders and center of srcrect into the borders and middle of dstrect, or 1.0f for an unscaled copy. \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.4.0.

\sa SDL_RenderTexture \sa SDL_RenderTexture9Grid

extern SDL_DECLSPEC bool SDLCALL SDL_RenderTexture9GridTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect, float tileScale)

Implementation

bool sdlRenderTexture9GridTiled(
  Pointer<SdlRenderer> renderer,
  Pointer<SdlTexture> texture,
  Pointer<SdlFRect> srcrect,
  double leftWidth,
  double rightWidth,
  double topHeight,
  double bottomHeight,
  double scale,
  Pointer<SdlFRect> dstrect,
  double tileScale,
) {
  final sdlRenderTexture9GridTiledLookupFunction = _libSdl
      .lookupFunction<
        Uint8 Function(
          Pointer<SdlRenderer> renderer,
          Pointer<SdlTexture> texture,
          Pointer<SdlFRect> srcrect,
          Float leftWidth,
          Float rightWidth,
          Float topHeight,
          Float bottomHeight,
          Float scale,
          Pointer<SdlFRect> dstrect,
          Float tileScale,
        ),
        int Function(
          Pointer<SdlRenderer> renderer,
          Pointer<SdlTexture> texture,
          Pointer<SdlFRect> srcrect,
          double leftWidth,
          double rightWidth,
          double topHeight,
          double bottomHeight,
          double scale,
          Pointer<SdlFRect> dstrect,
          double tileScale,
        )
      >('SDL_RenderTexture9GridTiled');
  return sdlRenderTexture9GridTiledLookupFunction(
        renderer,
        texture,
        srcrect,
        leftWidth,
        rightWidth,
        topHeight,
        bottomHeight,
        scale,
        dstrect,
        tileScale,
      ) ==
      1;
}