Skip to content

Commit

Permalink
Draw SDL3
Browse files Browse the repository at this point in the history
  • Loading branch information
Starbuck5 committed Jan 28, 2025
1 parent b6d2987 commit 546f11c
Show file tree
Hide file tree
Showing 3 changed files with 178 additions and 136 deletions.
8 changes: 8 additions & 0 deletions src_c/_pygame.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ PG_GetSurfaceFormat(SDL_Surface *surf)
return SDL_GetPixelFormatDetails(surf->format);
}

#define PG_GetSurfacePalette SDL_GetSurfacePalette

#define PG_GetRGBA SDL_GetRGBA
#define PG_GetRGB SDL_GetRGB
#define PG_MapRGBA SDL_MapRGBA
Expand Down Expand Up @@ -225,6 +227,12 @@ PG_GetSurfaceFormat(SDL_Surface *surf)
return surf->format;
}

static inline SDL_Palette *
PG_GetSurfacePalette(SDL_Surface *surf)
{
return surf->format->palette;
}

// NOTE:
// palette is part of the format in SDL2, so these functions below have it
// as a separate parameter to be consistent with the SDL3 signature.
Expand Down
Loading

0 comments on commit 546f11c

Please sign in to comment.