Skip to content

Commit 04ae5e1

Browse files
committed
Rewrite introductory documentation
1 parent 967eab8 commit 04ae5e1

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ members = ["run-wasm"]
55
name = "softbuffer"
66
version = "0.4.8"
77
edition = "2021"
8-
description = "Cross-platform software buffer"
8+
description = "Cross-platform buffer for software rendering"
99
license = "MIT OR Apache-2.0"
1010
documentation = "https://docs.rs/softbuffer"
1111
repository = "https://github.com/rust-windowing/softbuffer"

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Softbuffer
22

3-
Enables software rendering via drawing an image straight to a window.
3+
Render an image on the CPU and show it on a window in a cross-platform manner.
44

5-
Softbuffer integrates with the [`raw-window-handle`](https://crates.io/crates/raw-window-handle) crate
6-
to allow writing pixels to a window in a cross-platform way while using the very high quality dedicated window management
7-
libraries that are available in the Rust ecosystem.
5+
To use Softbuffer, first create a window using `winit`, `sdl3`, or any other crate that provides a [`raw_window_handle::HasWindowHandle`](https://docs.rs/raw-window-handle/0.6.2/raw_window_handle/trait.HasWindowHandle.html).
6+
7+
Next, you create a [`Context`] and [`Surface`] from that window, and can now call [`Surface::buffer_mut()`] to get a [`Buffer`] that you can draw into. Once you're done drawing, call [`Buffer::present()`] to show the buffer on the window.
8+
9+
Note that Softbuffer only provides the `&mut [...]` buffer, it does not provide any rendering primitives for drawing rectangles, circles, curves and so on. For that, you'll want to use a crate like [`tiny-skia`](https://docs.rs/tiny-skia/) or [`vello_cpu`](https://docs.rs/vello_cpu/).
810

911
## Platform support:
1012

0 commit comments

Comments
 (0)