SDL icon indicating copy to clipboard operation
SDL copied to clipboard

add SDL_RenderTextureAffine

Open expikr opened this issue 1 year ago • 2 comments

Closes #11279

This is the lowest-possible overhead API for planar texture copy, leaving the responsibility of calculating the points entirely to the users, allowing them to perform flips, stretches, shears, and rotations by calculating the basis vectors directly.

bool SDL_RenderTextureAffine(
    SDL_Renderer *renderer, 
    SDL_Texture *texture,
    const SDL_FRect *srcrect,
    const SDL_FPoint *origin,
    const SDL_FPoint *right,
    const SDL_FPoint *down
)
Type Name Description
SDL_Renderer * renderer the renderer which should copy parts of a texture.
SDL_Texture * texture the source texture.
const SDL_FRect * srcrect a pointer to the source rectangle, or NULL for the entire texture.
const SDL_FPoint * origin a pointer to a point indicating the location the top-left corner of srcrect should be mapped to, or NULL for the rendering target's origin.
const SDL_FPoint * right a pointer to a point indicating the location the top-right corner of srcrect should be mapped to, or NULL for the rendering target's top-right corner.
const SDL_FPoint * down a pointer to a point indicating the location the bottom-left corner of srcrect should be mapped to, or NULL for the rendering target's bottom-left corner.

image

expikr avatar Oct 28 '24 02:10 expikr

Isn't this already achievable by using the RenderGeometry API?

slouken avatar Oct 30 '24 05:10 slouken