wgpu/examples/capture
Andreas Reich 507101987b
Make StoreOp an enum instead of a bool (#4147)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-09-18 14:58:41 -04:00
..
src Make StoreOp an enum instead of a bool (#4147) 2023-09-18 14:58:41 -04:00
Cargo.toml Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
README.md Formatting and example command fixes (#3872) 2023-06-15 20:05:26 +00:00
screenshot.png Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00

capture

This example shows how to capture an image by rendering it to a texture, copying the texture to a buffer, and retrieving it from the buffer.

This could be used for "taking a screenshot," with the added benefit that this method doesn't require a window to be created.

To Run

cargo run --bin capture
open examples/capture/red.png

Screenshots

Capture example