mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-13 07:33:34 +00:00
implementing endianness check on mlx_color struct
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
/* By: maldavid <contact@kbz8.me> +#+ +:+ +#+ */
|
/* By: maldavid <contact@kbz8.me> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2022/10/04 16:56:35 by maldavid #+# #+# */
|
/* Created: 2022/10/04 16:56:35 by maldavid #+# #+# */
|
||||||
/* Updated: 2024/12/16 23:11:59 by maldavid ### ########.fr */
|
/* Updated: 2024/12/17 00:15:34 by maldavid ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@@ -48,10 +48,17 @@ typedef union mlx_color
|
|||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
#if MLX_ENDIAN_ORDER == MLX_LITTLE_ENDIAN
|
||||||
uint8_t a;
|
uint8_t a;
|
||||||
uint8_t b;
|
uint8_t b;
|
||||||
uint8_t g;
|
uint8_t g;
|
||||||
uint8_t r;
|
uint8_t r;
|
||||||
|
#else
|
||||||
|
uint8_t r;
|
||||||
|
uint8_t g;
|
||||||
|
uint8_t b;
|
||||||
|
uint8_t a;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
uint32_t rgba;
|
uint32_t rgba;
|
||||||
} mlx_color;
|
} mlx_color;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/11/10 08:49:17 by maldavid #+# #+# */
|
/* Created: 2023/11/10 08:49:17 by maldavid #+# #+# */
|
||||||
/* Updated: 2024/12/16 16:16:07 by maldavid ### ########.fr */
|
/* Updated: 2024/12/17 00:14:47 by maldavid ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@@ -142,6 +142,10 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define MLX_LITTLE_ENDIAN 0x41424344UL
|
||||||
|
#define MLX_BIG_ENDIAN 0x44434241UL
|
||||||
|
#define MLX_ENDIAN_ORDER ('ABCD')
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#define MLX_MAKE_VERSION(major, minor, patch) ((((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch)))
|
#define MLX_MAKE_VERSION(major, minor, patch) ((((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch)))
|
||||||
|
|||||||
Reference in New Issue
Block a user