SFML/.github/pull_request_template.md
Chris Thrasher 59447dd8e5 Rewrite sf::Event API to improve type safety
This new API is built on top of std::variant. This allows us to
store many different event types in a space-efficient way and access
the active event type in a type-safe manner that eliminates the
categories of UB that are possible with unions.

Co-authored-by: kimci86 <kimci86@hotmail.fr>
2024-05-01 18:00:58 +00:00

53 lines
1.5 KiB
Markdown

<!--
Thanks a lot for making a contribution to SFML! 🙂
Before you create the pull request, we ask you to check the follow boxes. (For small changes not everything needs to ticked, but the more the better!)
- [ ] Has this change been discussed on [the forum](https://en.sfml-dev.org/forums/index.php#c3) or in an issue before?
- [ ] Does the code follow the SFML [Code Style Guide](https://www.sfml-dev.org/style.php)?
- [ ] Have you provided some example/test code for your changes?
- [ ] If you have additional steps which need to be performed list them as tasks!
-->
## Description
<!-- Please describe your pull request. -->
This PR is related to the issue #
## Tasks
- [ ] Tested on Linux
- [ ] Tested on Windows
- [ ] Tested on macOS
- [ ] Tested on iOS
- [ ] Tested on Android
## How to test this PR?
<!-- Describe how to best test these changes. -->
<!-- Please provide a [minimal, complete and verifiable example](https://stackoverflow.com/help/mcve) if possible, you can use the follow template as a start: -->
```cpp
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode({1280, 720}), "Minimal, complete and verifiable example");
window.setFramerateLimit(60);
while (window.isOpen())
{
for (sf::Event event; window.pollEvent(event);)
{
if (event.is<sf::Event::Closed>())
window.close();
}
window.clear();
window.display();
}
}
```