Skip to content

Commit

Permalink
Merge pull request #3278 from Starbuck5/draw-sdl3
Browse files Browse the repository at this point in the history
SDL3: restructure cliprect handling in draw.c
  • Loading branch information
zoldalma999 authored Jan 5, 2025
2 parents 56ef5c9 + 41a8e94 commit 0ddbe21
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 0ddbe21

Please sign in to comment.