Skip to content

Commit 0ddbe21

Browse files
authored
Merge pull request #3278 from Starbuck5/draw-sdl3
SDL3: restructure cliprect handling in draw.c
2 parents 56ef5c9 + 41a8e94 commit 0ddbe21

File tree

2 files changed

+574
-433
lines changed

2 files changed

+574
-433
lines changed

src_c/_pygame.h

+10
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
#include <SDL.h>
4848
#endif
4949

50+
#include "stdbool.h"
51+
5052
#if SDL_VERSION_ATLEAST(3, 0, 0)
5153
#define PG_ShowCursor SDL_ShowCursor
5254
#define PG_HideCursor SDL_HideCursor
@@ -119,6 +121,8 @@ PG_UnlockMutex(SDL_mutex *mutex)
119121

120122
#define PG_INIT_TIMER 0
121123

124+
#define PG_GetSurfaceClipRect SDL_GetSurfaceClipRect
125+
122126
#else /* ~SDL_VERSION_ATLEAST(3, 0, 0)*/
123127
#define PG_ShowCursor() SDL_ShowCursor(SDL_ENABLE)
124128
#define PG_HideCursor() SDL_ShowCursor(SDL_DISABLE)
@@ -190,6 +194,12 @@ PG_UnlockMutex(SDL_mutex *mutex)
190194

191195
#define PG_SurfaceHasRLE SDL_HasSurfaceRLE
192196

197+
static inline bool
198+
PG_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect)
199+
{
200+
*rect = surface->clip_rect;
201+
return true;
202+
}
193203
#endif
194204

195205
/* DictProxy is useful for event posting with an arbitrary dict. Maintains

0 commit comments

Comments
 (0)