Skip to content

Commit a5002cf

Browse files
authored
Merge pull request #3166 from Starbuck5/image-sdl3
Image module SDL3 support
2 parents 5af69f9 + a20c77e commit a5002cf

File tree

5 files changed

+143
-88
lines changed

5 files changed

+143
-88
lines changed

src_c/_pygame.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ PG_UnlockMutex(SDL_mutex *mutex)
9898
return 0;
9999
}
100100

101-
#define PG_SURF_BitsPerPixel(surf) surf->format->bits_per_pixel
102-
#define PG_SURF_BytesPerPixel(surf) surf->format->bytes_per_pixel
101+
#define PG_SURF_BitsPerPixel(surf) SDL_BITSPERPIXEL(surf->format)
102+
#define PG_SURF_BytesPerPixel(surf) SDL_BYTESPERPIXEL(surf->format)
103103
#define PG_FORMAT_BitsPerPixel(format) format->bits_per_pixel
104104
#define PG_FORMAT_BytesPerPixel(format) format->bytes_per_pixel
105105

@@ -138,7 +138,7 @@ PG_UnlockMutex(SDL_mutex *mutex)
138138

139139
#define PG_CreateSurface(width, height, format) \
140140
SDL_CreateRGBSurfaceWithFormat(0, width, height, 0, format)
141-
#define PG_CreateSurfaceFrom(pixels, width, height, pitch, format) \
141+
#define PG_CreateSurfaceFrom(width, height, format, pixels, pitch) \
142142
SDL_CreateRGBSurfaceWithFormatFrom(pixels, width, height, 0, pitch, format)
143143
#define PG_ConvertSurface(src, fmt) SDL_ConvertSurface(src, fmt, 0)
144144
#define PG_ConvertSurfaceFormat(src, pixel_format) \

0 commit comments

Comments
 (0)