Animate a pendulum: Difference between revisions
Content added Content deleted
Recombinant (talk | contribs) (Add Zig solution) |
Recombinant (talk | contribs) m (→{{header|Zig}}: update @intToFloat() to @floatFromInt()) |
||
Line 5,581: | Line 5,581: | ||
while (!c.WindowShouldClose()) // Detect window close button or ESC key |
while (!c.WindowShouldClose()) // Detect window close button or ESC key |
||
{ |
{ |
||
const half_width = @ |
const half_width = @as(f32, @floatFromInt(c.GetScreenWidth())) / 2; |
||
const pivot = c.Vector2{ .x = half_width, .y = 0 }; |
const pivot = c.Vector2{ .x = half_width, .y = 0 }; |
||