Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
optimization, map mouse button and modifier flags to sdl2 ones #17172
Why use custom mouse button and mouse button key modifier flags rather than using the same value as defined in SDL2. This is already done for key codes.
In SdlInput.cs it avoid the need for each mouse movement to have to execute at least 5 comparisons, 5 logical AND operations + 5 logical OR operations, plus possible casts to int.
A lot of statements to check if the "middle mouse button" + "shift" was pressed.
Executed for each mouse event.
Alternatively you could perhaps use a mapping table, but depending on the values used by SDL it would have to be of size int.