glfw: respect negative coordinates in window #393

Merged
jane0009 merged 1 commit from fix-negative-coordinates into main 2022-07-09 01:01:51 +00:00
jane0009 commented 2022-07-07 17:44:42 +00:00 (Migrated from github.com)

While attempting to run the mach examples on WSLg, I ran into an issue using the OpenGL backend:

thread 11857 panic: attempt to cast negative value to unsigned integer
/home/jane/mach/glfw/src/Window.zig:581:22 0x4af643 in Platform.init (example-boids)
    return Pos{ .x = @intCast(u32, x), .y = @intCast(u32, y) };
                     ^

the simplest solution, to use a signed integer instead of an unsigned one, worked perfectly fine to resolve this issue and the example built and ran without issue afterwards.


  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
While attempting to run the mach examples on WSLg, I ran into an issue using the OpenGL backend: ``` thread 11857 panic: attempt to cast negative value to unsigned integer /home/jane/mach/glfw/src/Window.zig:581:22 0x4af643 in Platform.init (example-boids) return Pos{ .x = @intCast(u32, x), .y = @intCast(u32, y) }; ^ ``` the simplest solution, to use a signed integer instead of an unsigned one, worked perfectly fine to resolve this issue and the example built and ran without issue afterwards. --- - [x] By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
iddev5 commented 2022-07-08 07:32:36 +00:00 (Migrated from github.com)

I think this is correct, window positions can be negative. Though I think it can safely just be i32

I think this is correct, window positions can be negative. Though I think it can safely just be ``i32``
iddev5 (Migrated from github.com) approved these changes 2022-07-08 07:33:04 +00:00
emidoots (Migrated from github.com) approved these changes 2022-07-09 01:01:41 +00:00
emidoots (Migrated from github.com) left a comment

Thanks for this!

Thanks for this!
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach!393
No description provided.