Skip to content

feat: Add support for converting between TextureFormat and PixelFormat - #482

Open
olbyolby wants to merge 2 commits into
vhspace:masterfrom
olbyolby:colby
Open

olbyolby wants to merge 2 commits into
vhspace:masterfrom
olbyolby:colby

Conversation

@olbyolby

Copy link
Copy Markdown

SDL3 exposes the functions SDL_GetGPUTextureFormatFromPixelFormat() and SDL_GetPixelFormatFromGPUTextureFormat() for converting between SDL_PixelFormat and SDL_GPUTextureFormat types.

However, sdl3-rs does not expose any safe interface for that conversion. This PR adds a From<> impl for both gpu::TextureFormat and pixels::PixelFormat to convert between eachother safely.

@olbyolby olbyolby changed the title Add support for converting between TextureFormat and PixelFormat feat: Add support for converting between TextureFormat and PixelFormat Oct 17, 2026

This branch has not been deployed

No deployments
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.

1 participant