SDL3_ttf: make SubStringFlags a bit_field

This commit is contained in:
0xrsp
2025-05-11 00:25:31 +09:30
parent ac1c97eb33
commit 45c3361b43
+6 -17
View File
@@ -110,23 +110,12 @@ GPUTextEngineWinding :: enum c.int {
COUNTER_CLOCKWISE,
}
// NOTE: Unsure how to translate this as it is a bitset but also has a mask component
// so bit_set isnt really suitable
/*
typedef Uint32 TTF_SubStringFlags;
#define TTF_SUBSTRING_DIRECTION_MASK 0x000000FF /**< The mask for the flow direction for this substring */
#define TTF_SUBSTRING_TEXT_START 0x00000100 /**< This substring contains the beginning of the text */
#define TTF_SUBSTRING_LINE_START 0x00000200 /**< This substring contains the beginning of line `line_index` */
#define TTF_SUBSTRING_LINE_END 0x00000400 /**< This substring contains the end of line `line_index` */
#define TTF_SUBSTRING_TEXT_END 0x00000800 /**< This substring contains the end of the text */
*/
SubStringFlags :: enum SDL.Uint32 {
DIRECTION_MASK = 0xFF,
TEXT_START = 0x100,
LINE_START = 0x200,
LINE_END = 0x400,
TEXT_END = 0x800,
SubStringFlags :: bit_field SDL.Uint32 {
direction: u8 | 8,
text_start: bool | 1,
line_start: bool | 1,
line_end: bool | 1,
text_end: bool | 1,
}
SubString :: struct {