-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
SDL_GetRGBA, SDL_GetRGB are hard to use correctly #8320
Comments
Relatedly, I'm not sure that the uses of |
As long as the documentation has a big "this is not fast!" warning on it, that's fine with me. |
As seen in #8317, to do format-sensitive colour conversion, you have to memcpy the right number of bytes into the low-order bits of a Uint32 (which do not necessarily start at byte 0!), and then pass that to SDL_GetRGBA() or SDL_GetRGB() to decode it into its colour channels. This seems unnecessarily tricky to get right.
One possibility to make this easier (and make implementing #8319 easier, if we want it) would be to change their signature from the current:
to be something more like
and do the "memcpy the right number of bytes into the low-order bits of a Uint32" step internally.
This might be troublesome for
src/render/software/SDL_drawline.c
, though.The text was updated successfully, but these errors were encountered: