Closed alexjgriffith closed 2 years ago
Closing, this is just a repeat of #17. For those who come across this in the future check https://github.com/ziglang/zig/issues/1481
Note, we seem to be receiving structs fine from C, we just are unable to send some, like Vector2
s. Color
s seem to pass back and forth ok.
After additional testing, this appears to be a regression. Using Zig 9.1 avoids this C ABI issue
Running into an issue when printing text using
DrawTextEx
. The font size is over ridden by they
member of theVector2
struct. As you increaseposition.y
the text size increases.Not sure if this is a raylib issue, a zig issue, or a me issue.
Code Example
GDB Step Through
When I walk through
DrawTextEx
in GDB we can see theVector2
somehow loses its y value and that value ends up shifting thefontSize
parameter into thespacing
parameter.Before we enter
DrawTextEx
we can see that position is still `{x=10,y=10}The call to enter position is wrong. The
fontSize
should be 8 and thespacing
should be 1.Looking at position from within
DrawTextEx
we can see thatposition.y
has been set to 0As we saw from the call to
Draw Text Ex
fontSize
is 10 andspacing
is 8. These should be 8 and 1 respectivlyI cant tell if there is an issue with
tint
, the struct signature looks a little off.GDB Disassembly
Disassembling the lead into the
DrawTextEx
function yields:edit: extracted position to demonstrate issue via GDB