Skip to content

Commit 8f2f58d

Browse files
committed
Add [Flags] attribute to multiple enums in SDL3
This commit introduces the `[Flags]` attribute to several enumerations in the `Hexa.NET.SDL3` namespace. The affected enums include `SDLGPUColorComponentFlags`, `SDLInitFlags`, `SDLKeymod`, `SDLMessageBoxFlags`, `SDLMouseButtonFlags`, and `SDLWindowFlags`. This enhancement allows for bitwise operations on the enum values, enabling the combination of multiple flags in a single variable, thus improving flexibility and usability in scenarios requiring multiple options.
1 parent bb313a9 commit 8f2f58d

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

Hexa.NET.SDL3/SDLGPUColorComponentFlags.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
namespace Hexa.NET.SDL3
1414
{
15+
[Flags]
1516
public enum SDLGPUColorComponentFlags : byte
1617
{
1718
R = (byte)(1u<<0),

Hexa.NET.SDL3/SDLInitFlags.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
namespace Hexa.NET.SDL3
1414
{
15-
public enum SDLInitFlags : uint
15+
[Flags]
16+
public enum SDLInitFlags : uint
1617
{
1718
Timer = 0x00000001u,
1819
Audio = 0x00000010u,

Hexa.NET.SDL3/SDLKeymod.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
namespace Hexa.NET.SDL3
1414
{
15-
public enum SDLKeymod : ushort
15+
[Flags]
16+
public enum SDLKeymod : ushort
1617
{
1718
None = unchecked((ushort)0x0000u),
1819
Lshift = unchecked((ushort)0x0001u),

Hexa.NET.SDL3/SDLMessageBoxFlags.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
namespace Hexa.NET.SDL3
1414
{
15-
public enum SDLMessageBoxFlags : uint
15+
[Flags]
16+
public enum SDLMessageBoxFlags : uint
1617
{
1718
Error = 0x00000010u,
1819
Warning = 0x00000020u,

Hexa.NET.SDL3/SDLMouseButtonFlags.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
namespace Hexa.NET.SDL3
1414
{
15-
public enum SDLMouseButtonFlags : uint
15+
[Flags]
16+
public enum SDLMouseButtonFlags : uint
1617
{
1718
Left = 1,
1819
Middle = 2,

Hexa.NET.SDL3/SDLWindowFlags.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
namespace Hexa.NET.SDL3
1515
{
16-
public enum SDLWindowFlags : uint
16+
[Flags]
17+
public enum SDLWindowFlags : uint
1718
{
1819
Fullscreen = (0x0000000000000001),
1920
Opengl = (0x0000000000000002),

0 commit comments

Comments
 (0)