Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsGestureDetected inconsistent parameters #3463

Closed
jestarray opened this issue Oct 25, 2023 · 1 comment · Fixed by #3464
Closed

IsGestureDetected inconsistent parameters #3463

jestarray opened this issue Oct 25, 2023 · 1 comment · Fixed by #3464

Comments

@jestarray
Copy link
Contributor

// src/rgestures.h line 127
bool IsGestureDetected(int gesture);                    // Check if a gesture have been detected

// src/raylib.h line 1170
RLAPI bool IsGestureDetected(unsigned int gesture);     // Check if a gesture have been detected

how come one is int and the other is unsigned int? Which one should it be? Originally it was an int(in rust bindings)

@ghost
Copy link

ghost commented Oct 25, 2023

@jestarray gesture is enum (L79-L91). Quoting this answer: "An enum is guaranteed to be represented by an integer, but the actual type (and its signedness) is implementation-dependent."

In the case of IsGestureDetected() I don't think it matters, since underflowing or overflowing that parameter will be out of bounds of that enum valid gestures anyway. But, IMHO, could probably be changed to int gesture on raylib.h just for the sake of consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant