piston
piston copied to clipboard
Window coordinates are broken?
After upgrading to the latest Piston dependencies, window coordinates seem to be broken, at least on OSX. Here is a screen capture of the Hello World example demonstrating the error. The same thing occurs for every application I've tested, including the Piston examples and my home-grown apps.
Seems to be broken on the Glutin window back-end.
You can switch to let window: PistonWindow<(), Sdl2Window> = ...
to fix the problem temporarily.
This requires extern crate sdl2_window;
and use sdl2_window::Sdl2Window;
.
Thanks! Good to know. Should I post this issue to the glutin_window Github?
Not necessary. It is probably a small fix.
The "user_input" example seem to work?
There is an issue on Glutin about the origin moving on Retina displays https://github.com/tomaka/glutin/issues/503
I guess that there are two bugs involved here, 1) that moves the origin and 2) related to resizing.
The "user_input" example is used to test backends but does not use PistonWindow
. It could be that the second bug is triggered by PistonWindow
.
GlutinWindow
does not emit resize events.
The second bug is caused by https://github.com/tomaka/glutin/issues/445
I've fixed the second bug https://github.com/PistonDevelopers/piston_window/pull/74.
Thanks!
So just to confirm, PistonWindow
's default config is still broken pending the GlutinWindow
fix, correct?
In the meantime, cargo update
and switching to Sdl2Window
per your instructions above worked for me.
For Retina displays it is pending on https://github.com/tomaka/glutin/issues/503.
This might be related to an issue I have been running into when going through sudoku tutorial. I have been trying to figure out why my y-axis is off the screen. I finally cloned the Piston-Tutorial repo and ran the sudoku tutorial and saw that it works fine. However, I eventually realized it worked because it was using an older version of the dependencies in the Cargo.lock
file. When I delete the Cargo.lock
file, clean, and re-build it gets the latest version where the y axis is offset. See images below.
[dependencies]
# working version
piston = "0.35.0"
piston2d-graphics = "0.23.0"
piston2d-opengl_graphics = "0.49.0"
pistoncore-glutin_window = "0.42.0"
# latest version where screen is off
# piston = "0.36.0"
# piston2d-graphics = "0.26.0"
# piston2d-opengl_graphics = "0.52.0"
# pistoncore-glutin_window = "0.45.3"
Closing as outdated.