pixels/examples
Aeledfyr c96e46d3d4
Add a method to convert cursor coords to pixel coords (#77)
* Add a method to convert cursor coords to pixel coords

* Add method `window_pos_to_pixel` to Pixels struct
   * Converts cursor / window physical coordinates to pixel coords

* Fix formatting

* Return result rather than clamping pixel coordinates

* Use transformation matrices to convert from cursor coord to pixel

* Adds a struct ScalingMatrix that manages the creation and usage
  of the transformation matrix used in the renderer.
* Added an inverse function on ScalingMatrix - 4x4 matrix inverse
  (This should probably use a library, but it doesn't seem worth
  adding a dependancy for one function)

* Optimize matrix multiplication for cursor position calculation

* Use ultraviolet for matrix and vector math

* Add suggested changes

This keeps the split between usize and isize
This also changes the input cursor position to f32, because it was
immediately cast to an f32 for the transformations.
2020-05-20 21:37:29 -07:00
..
conway Add a method to convert cursor coords to pixel coords (#77) 2020-05-20 21:37:29 -07:00
invaders Fix panic in winit examples when pixels.render() returns Error (#70) 2020-04-13 20:38:51 -07:00
minimal-sdl2 Fix dependency bloat (#67) 2020-04-13 10:12:18 -07:00
minimal-winit Fix panic in winit examples when pixels.render() returns Error (#70) 2020-04-13 20:38:51 -07:00