Commit graph

34 commits

Author SHA1 Message Date
erin petra sofiya moon 763a7a9b41
update wgpu to 0.17 (#378)
required changes are entirely trivial:
wgpu::util::initialize_adapter_from_env's signature changed;
the backend_bits parameter is removed, and now solely specified by
the instance's enabled backends (see [the changelog](https://github.com/gfx-rs/wgpu/blob/trunk/CHANGELOG.md#initialize_adapter_from_env-argument-changes)).
2023-10-29 23:49:07 -05:00
Jay Oster 3891192796
Update dependencies (#337)
Breaking changes:

- Updates `wgpu` to 0.16
2023-06-11 21:25:25 -07:00
Aggelos Tselios 3d8c7bd0c9
Switch from imgui.frame to imgui.new_frame, (#353)
The documentation said to do so: https://docs.rs/imgui/latest/imgui/struct.Context.html\#method.frame.

Signed-off-by: Aggelos Tselios <androtechgr@gmail.com>
Co-authored-by: Aggelos Tselios <androtechgr@gmail.com>
2023-03-26 14:45:14 -07:00
Jay Oster 5a96eea6ba
Handle all wgpu::SurfaceError variants (#348)
This fixes error handling for all `wgpu::SurfaceError` variants. It also adds more context to error messages printed by the examples.

Closes #346
2023-03-21 07:16:51 -07:00
Jay Oster 899e27bafa
Remove get_ and set_ prefixes from public APIs (#341)
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.
2023-03-09 19:42:57 -08:00
Jay Oster 332a02f12d
Update wgpu to 0.15 (#332)
* Update wgpu to 0.15
* Fix the panic described in #330
* Specify `min_binding_size` since we know what it is.
2023-01-27 21:49:40 -08:00
Jay Oster 6f4fa6c967
Fix invalid texture sizes (#250)
- Makes methods fallible when they create textures.
- Correctly handle window resize in fltk example.
- TODO: tests
- Closes #240
2022-12-17 20:21:28 -08:00
Jay Oster 5c2985f1b6
Update all dependencies in the workspace (#323) 2022-12-17 17:35:02 -08:00
David Cristofaro e8d5cf3ebc
Bump wgpu from 0.13 to 0.14 (#320)
* 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>
2022-12-17 13:50:11 -08:00
Jay Oster 051a523ee6
Update wgpu to 0.13 (#300)
* Intial work towards wgpu 0.13

* Increase MSRV for egui

* Add missing texture formats

* Update fermium

- Replaces beryllium with our own hand-rolled high-level abstraction
  layer for SDL2.

* Update dependencies

Co-authored-by: JMS55 <47158642+JMS55@users.noreply.github.com>
2022-08-17 17:30:04 -07:00
Alex 0b380b637d
Allow accessing frame on immutable buffer (#288)
* Allow accessing frame on immutable buffer

* Rename `get_frame` to `get_frame_mut`

* Use `get_frame_mut` in examples
2022-08-14 15:44:23 -07:00
Jay Oster 5c1600926e
Update dependencies (#272)
* 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.
2022-04-25 05:04:51 -07:00
Jay Oster c1962ae35c
Update dependencies (#230)
* Move to Edition 2021
* Update `wgpu`, `raw-window-handle`, and all dependencies for the examples
* Update MSRV
* Closes #244
2021-12-31 14:57:57 -08:00
JMS55 800dd931b7
Update to wgpu 0.11 (#209)
Co-authored-by: Jay Oster <jay@kodewerx.org>
2021-10-08 11:49:51 -07:00
Jay Oster db00a67c60
Add user-defined errors for render functions (#196)
- Fixes #189
2021-09-04 09:00:25 -07:00
Jay Oster 0f8b1abe87
Update dependencies (#195) 2021-09-04 00:39:03 -07:00
Jay Oster 6225f7225a
Workaround unusual Cargo bug with git dependencies (#194)
- See #193
2021-09-02 17:17:44 -07:00
Jay Oster 210b373882
Add resolver = "2" to all examples (#192)
- These are ignored, but it should prevent copy-pasta errors from users
2021-09-01 21:48:51 -07:00
Jay Oster e08c91bfd2
Update to wgpu 0.10 (#187)
- It would be nice to return an error from the render function
- imgui-winit is still a WIP (open PR: https://github.com/Yatekii/imgui-wgpu-rs/pull/66)
- Update README

Co-authored-by: Mohammed Alyousef <mohammed.alyousef@neurosrg.com>
2021-09-01 14:50:43 -07:00
Jay Oster 303f1d90f5
Prepare 0.5.0 (#183)
* Prepare 0.5.0

* Update dependencies
2021-07-17 08:57:25 -07:00
Jay Oster 288da3675f
Use the swapchain-preferred texture format by default (#182)
- Fixes #140
- Adds a public method to get the current GPU framebuffer texture format (AKA the render texture format).
- This wasn't as difficult as it seemed; the extra API is used by the examples to get the right texture format instead of being hardcoded.
2021-07-17 08:21:49 -07:00
Jay Oster c4df23f65d
Update to wgpu 0.9 (#179)
* 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!
2021-06-27 11:09:29 -07:00
Jay Oster b76ae1f7bc
Update winit to 0.25 (#168)
- Update winit
- Update egui_winit_platform
- Update imgui_winit_support
- Fix hyperlink and resize in `egui-winit` example
2021-05-29 02:18:48 -07:00
Jay Oster f3d2b0643e
Fix UI colors in imgui-winit example (#166)
- Removes the sRGB workaround that was needed before `imgui-winit` 0.12
2021-05-08 23:14:26 -07:00
Jay Oster cdcfe57868
Validate width and height inputs (#162)
* Validate width and height inputs

- Fixes #157

* Add window size check to `imgui-winit` demo

- There is really nothing better that can be done in this case.
- The surface, buffer, and world sizes must all be non-zero.
- A zero-length surface would (previously) panic in `wgpu`.
- A zero-length buffer would panic with the new assertions.
- A zero-length world would cause a divide-by-zero panic when drawing.
2021-05-08 17:26:21 -07:00
Jay Oster f238814d12
Update wgpu to 0.8 (#160)
- Also update other dependencies
2021-05-07 23:52:11 -07:00
Jay Oster 8071f34a1f
Rename resize to resize_surface (#149)
- Also cleanup documentation.
- Workaround FLTK window resize issues by disabling resizability.
2021-03-09 04:15:24 -08:00
Jay Oster 333ce71468
Fix resize in the imgui-winit example (#145)
- Was originally resizing the pixel buffer with `PhysicalSize` units, which is definitely incorrect. (The pixel buffer is created with `LogicalSize` units.)
- Updated the World struct to retain its own size information.
2021-03-07 03:50:10 -08:00
JMS55 f2d4a4f084
Upgrade to wgpu 0.7 (#134)
Co-authored-by: Jay Oster <jay@kodewerx.org>
2021-02-28 15:29:36 -08:00
Josh 26ae25c3d8
Resize buffer (#136)
- Fixes #125
2021-02-28 14:05:28 -08:00
Jay Oster c522d12e0e
Fix build for imgui-winit example (#138)
- The dependencies are a mess!
- Had to fork `imgui-wgpu`, which sits between 0.12 and 0.13 (has support for `winit` 0.24, but not `wgpu` 0.7)
- This is a temporary fix for CI, until https://github.com/Yatekii/imgui-wgpu-rs/pull/44 is merged and a new release of `imgui-wgpu` is out
- The WIP `wgpu` 0.7 update in https://github.com/parasyte/pixels/pull/134 will be needed for `imgui-wgpu` 0.14
- Update MSRV for `imgui` 0.7
2021-02-06 13:13:04 -08:00
Jay Oster 0a893d6eff
Update all dependencies (#130) 2021-01-05 18:20:36 -08:00
Jay Oster 70ff52948b
Refactor builder (#128)
* Refactor PixelsBuilder into its own module

* Remove HasRawWindowHandle from public interface
2020-12-13 19:15:00 -08:00
Jay Oster 11dca72955
Add Dear ImGui example (#116)
* Add Dear ImGui example

- Closes #90

* Change argument order to match `render_with`

* Remove unnecessary borrow

* Refactor error messages

* Add a space

* Refactor Gui field privacy

* Add a menu bar and allow the about window to be closed

- The local bool is necessary because the menu bar closures are not allowed to borrow `self` for mutable access while `imgui::Ui<'ui>` is alive.
- The token-based menu bar lifetime is even more verbose than this.
2020-09-18 03:57:28 -07:00