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

Created intermediate enum for events #3

Merged
merged 5 commits into from
Oct 23, 2024

Conversation

VictorKoenders
Copy link
Contributor

@VictorKoenders VictorKoenders commented Sep 16, 2024

  • Adds an Event enum that also gets send to the EventHandler
  • Adds a way to get the total elapsed time since the game started; app.timer.total_time()
  • Adds a way to get a reference to the underlying glow handle
  • Added a new event WindowResized that gets triggered when a window gets resized
  • Made Gamepad a wrapper around Rc<GamepadInner> so this could be cloneable (since it's used in Event)
  • Added Keys RightShift, RightCtrl, RightAlt, LeftCommand, and RightCommand

@17cupsofcoffee
Copy link
Owner

Sorry for delay on reviewing this, dayjob has been a bit crazy recently! I will try to get to it soon :)

@VictorKoenders
Copy link
Contributor Author

No worries, take your time!

Copy link
Owner

@17cupsofcoffee 17cupsofcoffee left a comment

Choose a reason for hiding this comment

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

This all looks like reasonable changes to me - the only bit I'm mulling over slightly is the controller events returning joystick IDs (as there's nowhere else in the API you can actually use those - all the Input methods take a zero-indexed gamepad ID, so that you can just say 'gamepad 0' to get the first one that was plugged in).

It's a bit of a chicken and egg problem though, as at the point we convert from SDL event to our Event, we haven't assigned those gamepad IDs yet! So maybe it does make sense this way...

I'll give it some thought, and if I don't have any better ideas I'll merge as is 🙂

Copy link
Owner

@17cupsofcoffee 17cupsofcoffee left a comment

Choose a reason for hiding this comment

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

I'm going to go with this as-is for now - can always tweak it later if I figure out a different approach to the gamepad stuff.

Thanks for the PR (and the patience waiting weeks for me to review it 😅)

@17cupsofcoffee 17cupsofcoffee merged commit 7a79a0f into 17cupsofcoffee:main Oct 23, 2024
@VictorKoenders
Copy link
Contributor Author

Don't worry about it, thank you for making nova! 🙂

@VictorKoenders VictorKoenders deleted the event_refactor branch October 29, 2024 07:21
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 this pull request may close these issues.

2 participants