This renames:
- `get_frame` to `frame`
- `get_frame_mut` to `frame_mut`
- `set_clear_color` to `clear_color`
Which more closely follows convention set by the standard library et al.
* feat(wgpu): upgrade wgpu from 13 to 14
* Address feedback
* Bump tao in `minimal-tao` example
* Bump fltk in `minimal-fltk` example
* Bump egui in `minimal-egui` example
* Bump MSRV to `1.65`
* Bump crates in `imgui-winit` example
* Delete `minimal-sdl2` example
* Fix clippy lints
* Update examples/minimal-egui/src/gui.rs
Co-authored-by: Zageron <hello@zageron.ca>
Co-authored-by: Jay Oster <jay@kodewerx.org>
* Update dependencies
- Closes#270
* Unify controls in Invaders example
The fire button on gamepads was allowing trapid fire when holding the
button. Keyboard controls required the fire key to be released between
each shot fired. This commit fixes the difference by making the gamepad
fire button act like the keyboard fire key.
- Rather than setting the position and window size based on available
screen space, this PR just creates a window with a default size and
doesn't attempt to set the position.
- Closes#29
* Update to wgpu 0.9
* Fix validation error in WGSL shader
- This moves the hardcoded vertex positions and texture coordinates to
the vertex buffer.
- Replaces the two-triangle quad to 1 full-screen triangle (fixes#180)
- Rewrites the custom shader example to fix a bug with large surface
textures;
- The input texture size was used for the output texture, causing the
purple rectangle to appear very jumpy on large displays in full screen.
- The `ScalingRenderer` now exposes its clipping rectangle. The custom
shader example uses this for its own clipping rectangle, but it can
also be used for interacting with the border in general.
* Switch to `wgpu::include_wgsl!()`
- This is a nice little simplification.
- Thanks to @JMS55 for the suggestion!
* WIP: Render API v2
* Fix doctests
* Expose all of PixelsContext (#110)
* Fix ScalingRenderer::new() taking &mut Device
* Replace getters with direct access to &mut PixelsContext
* Fix wrong reference type
* Fix unneeded mut
* Remove unnecessary mutable borrow, resurrect the shorter getter methods
* Initial port to wgpu master (0.6)
Surface creation is broken (see examples)
Does not support compressed textures
* Fix SurfaceTexture and examples
* Add support for compressed texture formats
* resize doesn't need mutability
* Update documentation
* Update wgpu
* Prepare release
* Goodbye Travis! Thanks for all the fish
Co-authored-by: JMS55 <47158642+JMS55@users.noreply.github.com>
* 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.
* Move all examples to individual crates
* CI: Add libsdl2
* Use Ubuntu bionic for updated libsdl; 2.0.8
* Clippy
* libudev-dev is a dependency of libsdl2-dev
* Clippy
* Remove unnecessary dev-dependency
* `winit` is actually used in unit tests
* Fix a typo
* Move `simple-invaders` crate
* Add a conways game of life example
* Rustfmt conway example
* Respond to review feedback (p_width/p_height)
* Use line_drawing instead of manual bresenham
* Optimize count_neibs
* Remove inline(never) leftover from when profiling
* Bring back wrapping behavior (without regressing perf)
* Fix missing bounds check