Skip to content

Commit 5f4f8f8

Browse files
committed
Draw SDL3
1 parent 192743d commit 5f4f8f8

File tree

3 files changed

+178
-136
lines changed

3 files changed

+178
-136
lines changed

src_c/_pygame.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ PG_GetSurfaceFormat(SDL_Surface *surf)
130130
return SDL_GetPixelFormatDetails(surf->format);
131131
}
132132

133+
#define PG_GetSurfacePalette SDL_GetSurfacePalette
134+
133135
#define PG_GetRGBA SDL_GetRGBA
134136
#define PG_GetRGB SDL_GetRGB
135137
#define PG_MapRGBA SDL_MapRGBA
@@ -225,6 +227,12 @@ PG_GetSurfaceFormat(SDL_Surface *surf)
225227
return surf->format;
226228
}
227229

230+
static inline SDL_Palette *
231+
PG_GetSurfacePalette(SDL_Surface *surf)
232+
{
233+
return surf->format->palette;
234+
}
235+
228236
// NOTE:
229237
// palette is part of the format in SDL2, so these functions below have it
230238
// as a separate parameter to be consistent with the SDL3 signature.

0 commit comments

Comments
 (0)