-
Notifications
You must be signed in to change notification settings - Fork 359
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
[Core] Minor: it would be nice to make fontId pointer sized #148
Comments
@ColleagueRiley raised a similar point and I think you're right - the ergonomics are likely worth the increase in struct size here 🙂 |
@nicbarker #ifndef CLAY_FONT_ID
#define CLAY_FONT_ID u16
#endif This would allow users to use whatever type they like for their "font id", the same could be done for textures. If you choose that route.
I agree, I don't think anyone will complain about an extra 48 bits. |
|
@FintasticMan Yes, I think that's about the same as |
On a related note, I think the same could also go for the index in CLAY_IDI(). That way, structs could be used to store certain properties of an element, and a poiner to the struct could be the ID. (I had a similar issue to that and I was trying to get the first half of the pointer using casts and bitwise operations but i ended up giving up after like half an hour.)
|
It's part of the standard library, but not the part that you have to link against, so it's fair game for Clay. Clay can use things that are available in freestanding C implementations, just not things that are only available in hosted implementations. |
Very minor, but with certain renderer designs the implementation would be a tiny bit simpler if
Clay_TextElementConfig::textId
could fit a pointer instead of just a u16The text was updated successfully, but these errors were encountered: