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

native/linux: Use macro to reduce boilerplate #533

Merged
merged 2 commits into from
Feb 28, 2025
Merged

Conversation

bolphen
Copy link
Contributor

@bolphen bolphen commented Feb 26, 2025

This avoids writing the same function name 5 times in 3 different places.

I didn't convert the egl file yet. Did the egl file as well. The gl one seems to have its own macro.

The macro itself is inspired by the dlib crate, but I made it less verbose with the ... syntax. I'm also open to other suggestions.

Once this got merged I'll start submitting the PRs for the Wayland backend :)

@not-fl3
Copy link
Owner

not-fl3 commented Feb 28, 2025

Great work! 👍

I am little bit on the fence about ..., but can't really build a strong opinion on this. Intuitively explicit static/function etc lists would be easier to read, but not by much and we only use the macro a handful of times. I do not have very strong opinion on this tbh, very excited to see how it will turn out with wayland!

@not-fl3 not-fl3 merged commit 510ab74 into not-fl3:master Feb 28, 2025
11 checks passed
@bolphen
Copy link
Contributor Author

bolphen commented Feb 28, 2025

Cool!

Yeah worst case we could always change it in the future since it's not exposed to the user.

The Wayland backend is pretty much on a par with X11 now :) I'll open a PR

@bolphen bolphen deleted the macro branch February 28, 2025 21:23
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