From 0478a6ee3ba996a3159643ee8d68c57950a7eed2 Mon Sep 17 00:00:00 2001
From: Susko3 <[EMAIL REDACTED]>
Date: Sun, 22 Sep 2024 13:41:53 +0100
Subject: [PATCH] Move endian pixel format aliases into enum
Matches the same thing in `SDL_AudioFormat`.
---
include/SDL3/SDL_pixels.h | 44 +++++++++++++++++++--------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h
index 0c53a96528108..5034af65fa950 100644
--- a/include/SDL3/SDL_pixels.h
+++ b/include/SDL3/SDL_pixels.h
@@ -389,30 +389,30 @@ typedef enum SDL_PixelFormat
/* SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'), */
SDL_PIXELFORMAT_P010 = 0x30313050u, /**< Planar mode: Y + U/V interleaved (2 planes) */
/* SDL_DEFINE_PIXELFOURCC('P', '0', '1', '0'), */
- SDL_PIXELFORMAT_EXTERNAL_OES = 0x2053454fu /**< Android video texture format */
+ SDL_PIXELFORMAT_EXTERNAL_OES = 0x2053454fu, /**< Android video texture format */
/* SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ') */
-} SDL_PixelFormat;
-/* Aliases for RGBA byte arrays of color data, for the current platform */
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-#define SDL_PIXELFORMAT_RGBA32 SDL_PIXELFORMAT_RGBA8888
-#define SDL_PIXELFORMAT_ARGB32 SDL_PIXELFORMAT_ARGB8888
-#define SDL_PIXELFORMAT_BGRA32 SDL_PIXELFORMAT_BGRA8888
-#define SDL_PIXELFORMAT_ABGR32 SDL_PIXELFORMAT_ABGR8888
-#define SDL_PIXELFORMAT_RGBX32 SDL_PIXELFORMAT_RGBX8888
-#define SDL_PIXELFORMAT_XRGB32 SDL_PIXELFORMAT_XRGB8888
-#define SDL_PIXELFORMAT_BGRX32 SDL_PIXELFORMAT_BGRX8888
-#define SDL_PIXELFORMAT_XBGR32 SDL_PIXELFORMAT_XBGR8888
-#else
-#define SDL_PIXELFORMAT_RGBA32 SDL_PIXELFORMAT_ABGR8888
-#define SDL_PIXELFORMAT_ARGB32 SDL_PIXELFORMAT_BGRA8888
-#define SDL_PIXELFORMAT_BGRA32 SDL_PIXELFORMAT_ARGB8888
-#define SDL_PIXELFORMAT_ABGR32 SDL_PIXELFORMAT_RGBA8888
-#define SDL_PIXELFORMAT_RGBX32 SDL_PIXELFORMAT_XBGR8888
-#define SDL_PIXELFORMAT_XRGB32 SDL_PIXELFORMAT_BGRX8888
-#define SDL_PIXELFORMAT_BGRX32 SDL_PIXELFORMAT_XRGB8888
-#define SDL_PIXELFORMAT_XBGR32 SDL_PIXELFORMAT_RGBX8888
-#endif
+ /* Aliases for RGBA byte arrays of color data, for the current platform */
+ #if SDL_BYTEORDER == SDL_BIG_ENDIAN
+ SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888,
+ SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888,
+ SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888,
+ SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888,
+ SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888,
+ SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_XRGB8888,
+ SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_BGRX8888,
+ SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_XBGR8888
+ #else
+ SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888,
+ SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888,
+ SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888,
+ SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888,
+ SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888,
+ SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_BGRX8888,
+ SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_XRGB8888,
+ SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_RGBX8888
+ #endif
+} SDL_PixelFormat;
/**
* Pixels are a representation of a color in a particular color space.