Skip to content

feat(input): encapsulate joystick polling functions#213

Merged
Miou-zora merged 3 commits intomainfrom
210-input-manager-controller-polling
May 2, 2025
Merged

feat(input): encapsulate joystick polling functions#213
Miou-zora merged 3 commits intomainfrom
210-input-manager-controller-polling

Conversation

@ripel2
Copy link
Contributor

@ripel2 ripel2 commented Apr 29, 2025

Related to:

I have encapsulated the functions to get axes and buttons data

Note:

  • I did some refactors regarding functions inlining / exception throwing

@ripel2 ripel2 linked an issue Apr 29, 2025 that may be closed by this pull request
@ripel2 ripel2 self-assigned this Apr 29, 2025
@ripel2 ripel2 requested a review from a team April 29, 2025 14:54
@ripel2 ripel2 added the enhancement New feature or request label Apr 29, 2025
@ripel2 ripel2 marked this pull request as ready for review April 29, 2025 14:56
Comment on lines +11 to +12
using JoystickAxes = std::vector<float>;
using JoystickButtons = std::vector<unsigned char>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honeslty I don't understand those types. What are they purposes ? And when I look at them, they are always composed of 2 values, so shoud we use glm::vec2 instead of std::vector ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they are not, if you have a controller with multiple axes the vector won't have two values
same for the buttons, a controller can have a lot
those two types are made to make it cleaner to read, maybe it is not ? if not I can just use vectors

Copy link
Contributor Author

@ripel2 ripel2 Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to clarify: in the implementation, it looks like there are two values but it is not : it is a constructor of vectors that allows to create one based on raw pointers. so the size is not always 2

@ripel2 ripel2 requested a review from Miou-zora April 30, 2025 14:05
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 1, 2025

@Miou-zora Miou-zora merged commit ba80bde into main May 2, 2025
12 checks passed
@Miou-zora Miou-zora deleted the 210-input-manager-controller-polling branch May 2, 2025 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Input Manager controller polling

2 participants