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

SDL API renaming: SDL_pixels.h #6886

Closed
slouken opened this issue Dec 23, 2022 · 3 comments
Closed

SDL API renaming: SDL_pixels.h #6886

slouken opened this issue Dec 23, 2022 · 3 comments

Comments

@slouken
Copy link
Collaborator

slouken commented Dec 23, 2022

Here are proposed name changes for functions in SDL_pixels.h, per discussion in #6569

SDL_AllocFormat => SDL_CreatePixelFormat
SDL_AllocPalette => SDL_CreatePalette
SDL_FreeFormat => SDL_DestroyPixelFormat
SDL_FreePalette => SDL_DestroyPalette
SDL_GetPixelFormatName
SDL_GetRGB
SDL_GetRGBA
SDL_MapRGB
SDL_MapRGBA
SDL_MasksToPixelFormatEnum => SDL_GetPixelFormatEnumForMasks
SDL_PixelFormatEnumToMasks => SDL_GetMasksForPixelFormatEnum
SDL_SetPaletteColors
SDL_SetPixelFormatPalette

Original proposal, changing SDL_PixelFormat to SDL_SurfaceFormat, but which ended up not making sense in some contexts:

Structure:
SDL_PixelFormat => SDL_SurfaceFormat

Functions:
SDL_AllocFormat => SDL_CreateSurfaceFormat
SDL_AllocPalette => SDL_CreatePalette
SDL_FreeFormat => SDL_DestroySurfaceFormat
SDL_FreePalette => SDL_DestroyPalette
SDL_GetPixelFormatName
SDL_GetRGB
SDL_GetRGBA
SDL_MapRGB
SDL_MapRGBA
SDL_MasksToPixelFormatEnum => SDL_GetPixelFormatForMasks
SDL_PixelFormatEnumToMasks => SDL_GetMasksForPixelFormat
SDL_SetPaletteColors
SDL_SetPixelFormatPalette => SDL_SetSurfaceFormatPalette

@libsdl-org/a-team for discussion

@icculus
Copy link
Collaborator

icculus commented Dec 27, 2022

SDL_PixelFormat => SDL_SurfaceFormat

I'm not against this, but are these never meaningful outside of surfaces? And if so, should we just merge this into SDL_Surface?

@icculus
Copy link
Collaborator

icculus commented Dec 27, 2022

(Rest looks good in any case.)

@slouken
Copy link
Collaborator Author

slouken commented Dec 27, 2022

SDL_PixelFormat => SDL_SurfaceFormat

I'm not against this, but are these never meaningful outside of surfaces? And if so, should we just merge this into SDL_Surface?

Format structures are shared between surfaces, so we can't just merge them in, and they're also used as targets for blit mapping.

However, it would totally make sense to move the new structure and related functions to SDL_surface.h.

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

No branches or pull requests

2 participants