-
Notifications
You must be signed in to change notification settings - Fork 181
DrawTextureEx, DrawTexturePro, ect, not drawing #17
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
Comments
Thiis seems to be the same type of issue: ziglang/zig#10560, and the cause is that the C abi compatibility is not complete yet: ziglang/zig#1481. The |
I could verify that indeed this was the issue by creating a wrapper function in c: #include "../raylib-zig/raylib/src/raylib.h"
void _DrawTextureExWrapper(Texture2D tex, float x, float y, float rotation, float scale, Color color) {
Vector2 pos = { .x = x, .y = y };
DrawTextureEx(tex, pos, rotation, scale, color);
} When I called this function from zig, rendering of the texture worked as expected. |
Late to the party, but wanted to throw this out there: https://github.com/pfgithub/mousegame This project is old, but seems to have an interesting approach to working around this in the aptly named 'workaround' c, h, and zig files. Not sure how well it works in practice, but wanted to put it here for others to find and spur on more creative solutions, if nothing else. |
The way mousegame works around the issue indeed seems to be the only way at the moment. For raylib 3.0 there is the |
With ziglang/zig#1481 being closed, could you check this again? |
Passing structs smaller than 16 bytes is still broken when enabling any of the release optimizations in the latest 0.11.0-dev compiler. This breaks raymath completely, as it relies heavily on |
Another workaround is adding unused fields to the C structs. E.g. giving |
ziglang/zig#13830 and by extension ziglang/zig#14262 are closed. Could you check this again? |
Didn't retest the changes. But as long as these bindings officially only target zig 0.10.X, we should keep the issue open. The fix for sub-16 byte structs only exists in the 0.11.X branch. |
Good note. Once 0.11 is released I'll update the binding accordingly and all this will hopefully work |
Uh oh!
There was an error while loading. Please reload this page.
I was trying to draw scaled textures and I was not able to. While
DrawTexture
works, any of the other texture drawing methods that allow for scaling seem to be broken.If I try this zig code:
I only get a while screen, while the same code in C gives me the correct result:
I have tried with both system and compiled raylib and get the same results. I am using macOS:
The text was updated successfully, but these errors were encountered: