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

Introduce new esf::EventListener #160

Merged
merged 1 commit into from
Sep 26, 2024
Merged

Conversation

AndreasLrx
Copy link
Owner

Description

Introduce a new esf::EventListener in the esf::RenderWindow.

The listener is called when the RenderWindow.pollEvent is called, like in the esf::PollEvents system.

Example usage:

esf::RenderWindow &window =
    registry.addResource<esf::RenderWindow>(sf::VideoMode(1280, 720), "ECSTASY SFML integration: events");
window.setEventListener([&registry](const sf::Event &event) {
    std::cout << "Event " << event.type << std::endl;
    return false;
});
registry.addSystem<esf::PollEvents>();

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Added/updated tests?

  • New tests written
  • Existing tests updated
  • Functionnal demo updated as a test
  • Tests are not required because this is a documentation update
  • I need help with writing tests

@AndreasLrx AndreasLrx added enhancement New feature or request SFML SFML integration labels Sep 26, 2024
@AndreasLrx AndreasLrx added this to the SFML Integration milestone Sep 26, 2024
@AndreasLrx AndreasLrx self-assigned this Sep 26, 2024
@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.23%. Comparing base (e23abcc) to head (f42e78f).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #160   +/-   ##
=======================================
  Coverage   82.23%   82.23%           
=======================================
  Files          64       64           
  Lines        1103     1103           
  Branches      353      353           
=======================================
  Hits          907      907           
  Misses        140      140           
  Partials       56       56           
Flag Coverage Δ
82.23% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AndreasLrx AndreasLrx force-pushed the feature/sfml-event-listener branch from 611c134 to f42e78f Compare September 26, 2024 09:36
@AndreasLrx AndreasLrx merged commit d4b3855 into main Sep 26, 2024
4 checks passed
@AndreasLrx AndreasLrx deleted the feature/sfml-event-listener branch September 26, 2024 09:40
@AndreasLrx AndreasLrx restored the feature/sfml-event-listener branch September 26, 2024 09:41
@AndreasLrx AndreasLrx deleted the feature/sfml-event-listener branch September 26, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SFML SFML integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants