surface: Make a typedef for SDL_Surface bitflags, as is SDL3 policy.

Reference Issue #9812.
This commit is contained in:
Ryan C. Gordon 2024-05-16 12:29:58 -04:00
parent 253c917296
commit 241cfaf38f
No known key found for this signature in database
GPG key ID: FA148B892AB48044

View file

@ -43,21 +43,20 @@ extern "C" {
#endif #endif
/** /**
* \name Surface flags * The flags on an SDL_Surface.
* *
* These are the currently supported flags for an SDL_Surface. * These are generally meant to be considered read-only.
* *
* \internal * \since This datatype is available since SDL 3.0.0.
* Used internally (read-only).
*/ */
/* @{ */ typedef Uint32 SDL_SurfaceFlags;
#define SDL_SWSURFACE 0 /**< Just here for compatibility */ #define SDL_SWSURFACE 0 /**< Just here for compatibility */
#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */ #define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */
#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */ #define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */
#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */ #define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */
#define SDL_SIMD_ALIGNED 0x00000008 /**< Surface uses aligned memory */ #define SDL_SIMD_ALIGNED 0x00000008 /**< Surface uses aligned memory */
#define SDL_SURFACE_USES_PROPERTIES 0x00000010 /**< Surface uses properties */ #define SDL_SURFACE_USES_PROPERTIES 0x00000010 /**< Surface uses properties */
/* @} *//* Surface flags */
/** /**
* Evaluates to true if the surface needs to be locked before access. * Evaluates to true if the surface needs to be locked before access.
@ -119,7 +118,7 @@ typedef enum SDL_FlipMode
*/ */
typedef struct SDL_Surface typedef struct SDL_Surface
{ {
Uint32 flags; /**< Read-only */ SDL_SurfaceFlags flags; /**< Read-only */
SDL_PixelFormat *format; /**< Read-only */ SDL_PixelFormat *format; /**< Read-only */
int w, h; /**< Read-only */ int w, h; /**< Read-only */
int pitch; /**< Read-only */ int pitch; /**< Read-only */