Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add SDL_RenderTextureAffine #11353

Merged
merged 1 commit into from
Dec 6, 2024
Merged

add SDL_RenderTextureAffine #11353

merged 1 commit into from
Dec 6, 2024

Conversation

expikr
Copy link
Contributor

@expikr expikr commented Oct 28, 2024

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 expikr force-pushed the affinetexture branch 3 times, most recently from b2b7d5f to aceaae0 Compare October 28, 2024 03:03
@expikr expikr changed the title add SDL_RenderTexturePlg add SDL_RenderTextureAffine Oct 28, 2024
@slouken
Copy link
Collaborator

slouken commented Oct 30, 2024

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

@slouken slouken merged commit d0f1910 into libsdl-org:main Dec 6, 2024
39 checks passed
@expikr expikr deleted the affinetexture branch December 6, 2024 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SDL_RenderTextureRotated should accept angle in different notations
2 participants