Skip to content

SDL_Render (Clamp to) Border Texture Address Mode #13370

@DctrNoob

Description

@DctrNoob

I am longing for a texture address mode akin to OpenGL's CLAMP_TO_BORDER in SDL_Render. The big graphics APIs (OpenGL, D3D11 and 12, Vulkan, Metal as of macOS 12 and iOS 14) all support this and I was wondering why it is not offered in SDL_Render (and not in SDL_GPU afaik). All the workarounds I tried so far suck in some regard while just setting CLAMP_TO_BORDER solves things for me very nicely.

After some digging, I realized that setting the texture address mode in SDL_Render has in fact only recently been added to main and is part of the 3.4.0 milestone. Still, the available address modes do not include CLAMP_TO_BORDER or the like.

Obviously, adding it would entail to add API functions to define the border color as well.

Maybe you didn't add it so far because not every backend supports it (OpenGL ES does not, I think) and maybe you are strict about feature parity between backends, so feel free to reject this suggestion. However, it would make me a little sad (though I could imagine contributing this feature if it's a matter of workload).

Keep it up!

Best regards,

Thomas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions