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

Reduce EventHandler boilerplate? #74

Open
Supreeeme opened this issue Dec 24, 2024 · 1 comment · May be fixed by #76
Open

Reduce EventHandler boilerplate? #74

Supreeeme opened this issue Dec 24, 2024 · 1 comment · May be fixed by #76

Comments

@Supreeeme
Copy link

Currently, integrating with miniquad involves implementing miniquad's EventHandler trait, and delegating a bunch of functions to it. However, I feel like this could be done by egui-miniquad itself through some sort of trait + blanket impl, therefore reducing the amount of boilerplate needed to get up and running.

@PiotrekB416
Copy link

I don't think this is possible with traits since rust inheritance only guarantees struct with impl a parent trait, which still means you have to implement the methods manually.
Instead you can use a macro to generate the methods in an impl block.

@PiotrekB416 PiotrekB416 linked a pull request Dec 30, 2024 that will close this issue
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.

2 participants