Commit graph

226 commits

Author SHA1 Message Date
Jay Oster 0819b8f60c
Update GitHub Actions (#322)
* Update GitHub Actions

- actions-rs is unmaintained.
  - See: https://github.com/actions-rs/toolchain/issues/216
- Enable rust-cache
- Cargo.lock was removed in #63 but it's necessary for reproducible builds in CI.
  - The lock file is ignored by dependents.
  - Our separate `pixels-ci-rust-version` repo also ignores it, so CI will still be able to tell us if the crate build ever breaks due to unlocked dependencies.
  -  See the `rust-version` job in ci.yml.
2022-12-17 16:52:45 -08:00
Jay Oster 7278681422
Fix the GitHub Actions badge (#321)
See: https://github.com/badges/shields/issues/8671
2022-12-17 14:46:32 -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
Jeffrey Rosenbluth bc8235fdb1
Add tiny-skia example (#317)
* tiny skia example

* image

* remove unnecessary let binding
2022-11-15 11:47:28 -08:00
Jay Oster 0a85025345
Prepare 0.10.0 (#315) 2022-10-28 17:10:03 -07:00
Jay Oster 9f7896cd2f
Replace just with cargo-run-wasm (#310) 2022-10-02 21:13:48 -07:00
Jay Oster a2c639823f
Update winit 0.27 (#302)
* Update winit 0.27

Closes #292

This _does not_ update `winit` in the `imgui-winit` example. See https://github.com/parasyte/pixels/pull/302#issuecomment-1264483040 for discussion.
2022-10-01 14:27:21 -07:00
Jay Oster 9c3edeb1d4
HACK: Use old version of fltk to fix CI (#306)
See: https://github.com/fltk-rs/fltk-rs/issues/1285
2022-09-10 19:18:27 -07:00
Jay Oster 881033c5c7
Remove the exposed web feature (#304)
- The `web` feature was previously exposed by the example crate. This isn't really necessary.
- See #276 for discussion
2022-08-19 14:00:54 -07:00
Jay Oster 6605951d8c
Fix CI (#301)
- wgpu 0.13 requires Rust 1.59
2022-08-17 19:55:20 -07: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
Jay Oster bcbe9d84cb
Add minimal example with tao (#299)
* Add minimal example with `tao`

- Closes #298
2022-08-17 07:50:02 -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 4ee5006481
Add rust-version (#295)
- This version is different from the MSRV. It specifies the minimum
  version required to build the crate and its direct dependencies.
- Add a CI step for building the crate alone with the oldest version
  possible.
- See MSRV.md for the policy and minimal version supported by CI,
  including all example code.
- Update all actions to checkout/v3
2022-08-01 14:59:46 -07:00
Jay Oster 41063dbf4b
Fix minimize panicking on custom-shader example. (#291)
- Closes #282
2022-07-27 10:26:05 -07:00
Jay Oster 46ddf4e3f0
Fix custom-shader example on macOS (#286)
- Fixes #258
2022-06-20 10:12:30 -07:00
Jay Oster af821c9e49
Update egui to 0.18 (#281)
* Update egui to 0.18

- Closes #278

* Bump MSRV to 1.60.0 for egui
2022-06-13 21:03:06 -07:00
Jay Oster adaa469ad9
Update gilrs (#280) 2022-06-13 09:24:59 -07:00
Jay Oster 8f66bce12e
Comparison with softbuffer (#273) 2022-04-25 07:00:30 -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 2e7c822091
Fix CI with latest nightly Clippy (#271) 2022-04-25 03:48:35 -07:00
Jay Oster 94b87496c3
Update ultraviolet (#266) 2022-03-20 18:42:19 -07:00
Jay Oster ebd2bdbd04
Update egui (#264) 2022-03-20 13:24:20 -07:00
JMS55 94a2cc2dbd
Make BlendState configurable (#260) 2022-02-06 03:01:50 -08:00
AnonymousDapper ebf7179a89
Decouple render_texture_format from surface texture format (#249) (#257)
- Closes #249
2022-01-15 20:31:18 -08:00
Jay Oster 3968c9748a
Fix delta time in the invaders example (#252)
- Minor rewrite of the winit integration using the `game-loop` crate for
  fixed time-step updates.
- Updates are now handled at 240 fps, regardless of frame rate.
- Frame rate is capped at 240 fps.
- Adds a pause key.
- Closes #11
2022-01-08 10:44:52 -08:00
Jay Oster afd15436d6
Fix crash on Wayland (#251)
- 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
2022-01-08 04:57:23 -08:00
Jay Oster d4cc56df18
Remove cargo resolver references from docs (#248)
- This probably should have been included in the 0.9.0 release, since it is no longer relevant; we require Edition 2021 starting with 0.9.0.
2021-12-31 18:00:29 -08:00
Jay Oster 6cc4356cc3
Prepare 0.9.0 (#247) 2021-12-31 16:18:01 -08:00
Jay Oster d3dbc8b4f2
Use Fused-Multiply-Add (#246)
This reverts commit 598cf6c1ba.
2021-12-31 15:40:12 -08: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
Jay Oster 32e14dac7d
Fix CI (#245)
- Bump MSRV for https://github.com/rust-lang/rust/issues/78835
- Required by `fltk`: https://github.com/fltk-rs/fltk-rs/pull/1054
2021-12-29 20:11:41 -08:00
Jay Oster 598cf6c1ba
Revert "Use Fused-Multiply-Add (#232)" (#241)
This reverts commit bd2de37b84.
2021-12-07 17:43:30 -08:00
Jay Oster 4c6682e65b
Configurable clear color (#236)
- Closes #235
- Now using alpha blending (non-premultiplied) in the scaling renderer
  so that the clear color can be blended with the texture. This can be
  made configurable, but we'll go with this for now.
2021-12-05 14:23:06 -08:00
Jay Oster b15854b4d1
Clippy (#233) 2021-12-04 10:00:58 -08:00
Jay Oster bd2de37b84
Use Fused-Multiply-Add (#232)
- There are a few places in the `simple-invaders` crate that could use
  `f32::mul_add()` as well.
2021-12-04 09:08:29 -08:00
Jay Oster 2a4ebbf19d
Fix half-pixel offsets in scaling renderer (#231)
* Fix half-pixel offsets in scaling renderer

- This bug was very subtle. It can be hard to notice!
- Context: When the scaling renderer transformation matrix is created,
  it needs to center the image within the border.
- The previous code always evaluated the translation to (0, 0)
- This PR makes half-pixel adjustments to the translation when needed,
  making it impossible to rasterize the texture on a half-pixel
  boundary.
- I spotted this while working on pixel-aspect-ratio support, but it can
  most easily be witnessed in the `conway` example by grabbing the top
  or bottom resize handle on the window and slow dragging it up and down
  by 1-pixel-at-a-time. When you hit a half-pixel bug the entire texture
  will change slightly; some pixels will become hidden or duplicated.

* Bump MSRV
2021-12-01 21:36:56 -08:00
Jay Oster b2b8f1140d
Fix inverted Y-axis in window_pos_to_pixel() (#229)
- This fixes a regression caused by #228
2021-12-01 08:08:48 -08:00
Jay Oster c2454b01ab
Simplify vertex attributes (#228)
- Vertex UVs can be computed from the positions, which saves a small amount of code and a small amount of bandwidth (both inconsequential).
- This is mostly for readability.
- Fixes vertically-flipped pixel buffer in the `custom-shader` example.
2021-11-20 14:06:23 -08:00
Jay Oster fa03a61fa3
Prepare 0.8.0 (#227) 2021-11-16 12:13:40 -08:00
Jay Oster b185ec32e9
Initial WebGL2 support. (#218)
Co-authored-by: MarkAnthonyM <37249494+MarkAnthonyM@users.noreply.github.com>
2021-11-16 11:37:56 -08:00
Jay Oster acd42495f2
Use adapter limits (unless overridden) (#226)
- Fixes a regression caused by #223
- `downlevel_webgl2_defaults` only supports 2048x2048 pixels buffers
- This will allow pixel buffers up to the max supported by the hardware
2021-11-14 17:20:57 -08:00
Jay Oster 2a37e3ed1d
Update badges (#225) 2021-11-13 18:26:24 -08:00
Jay Oster 6662fec55b
Set default device limits to downlevel_webgl2_defaults (#223)
- Fixes #139
- See also #115
2021-11-12 11:01:32 -08:00
Jay Oster 0fc722e011
Refactor public API (#222)
* Simplify constructor return types

* Render methods do not need an exclusive borrow
2021-11-08 20:03:38 -08:00
Jay Oster 5b00f7e32f
Make SurfaceSize private (#220)
- This struct is only used internally. No need to make it public.
- Technically a breaking change, so this will bump the SemVer.
2021-11-02 22:05:10 -07:00
Jay Oster eb07e61f5c
Update egui to 0.15 (#217)
- Replaces `egui_winit_platform` with `egui-winit`
- Renames the example package to avoid crate name collision
2021-10-26 19:21:58 -07:00
Jay Oster efeec7f727
Fix minimal-fltk example release builds with Rust 1.56.0 (#216)
- See https://github.com/rust-lang/rust/issues/88576
2021-10-21 16:15:47 -07:00
Jay Oster 2c98dc3f33
Recommend Edition 2021 as an alternative to Cargo resolver version 2 (#215) 2021-10-21 15:57:15 -07:00
Jay Oster 9264a255bf
Remove patch number from dependency versions (#214)
- Cargo treats non-prefixed version numbers the same when the patch number is omitted.
- This is just cleaner and makes breaking updates easier to manage.
2021-10-17 14:26:56 -07:00