Skip to content

Commit

Permalink
SDL3: restructure cliprect handling in draw.c
Browse files Browse the repository at this point in the history
  • Loading branch information
Starbuck5 committed Jan 1, 2025
1 parent 6e7a153 commit 41a8e94
Show file tree
Hide file tree
Showing 2 changed files with 574 additions and 433 deletions.
10 changes: 10 additions & 0 deletions src_c/_pygame.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
#include <SDL.h>
#endif

#include "stdbool.h"

#if SDL_VERSION_ATLEAST(3, 0, 0)
#define PG_ShowCursor SDL_ShowCursor
#define PG_HideCursor SDL_HideCursor
Expand Down Expand Up @@ -119,6 +121,8 @@ PG_UnlockMutex(SDL_mutex *mutex)

#define PG_INIT_TIMER 0

#define PG_GetSurfaceClipRect SDL_GetSurfaceClipRect

#else /* ~SDL_VERSION_ATLEAST(3, 0, 0)*/
#define PG_ShowCursor() SDL_ShowCursor(SDL_ENABLE)
#define PG_HideCursor() SDL_ShowCursor(SDL_DISABLE)
Expand Down Expand Up @@ -190,6 +194,12 @@ PG_UnlockMutex(SDL_mutex *mutex)

#define PG_SurfaceHasRLE SDL_HasSurfaceRLE

static inline bool
PG_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect)
{
*rect = surface->clip_rect;
return true;
}
#endif

/* DictProxy is useful for event posting with an arbitrary dict. Maintains
Expand Down
Loading

0 comments on commit 41a8e94

Please sign in to comment.