From 9023b096d7ae35297682c6bfefba2ae6c7c3a487 Mon Sep 17 00:00:00 2001 From: David Johnson Date: Thu, 22 Dec 2022 18:43:54 -0600 Subject: [PATCH] Updated rest of the code to use softbuffer name instead of swbuf --- README.md | 12 ++++++------ examples/animation.rs | 2 +- examples/fruit.rs | 2 +- examples/winit.rs | 2 +- examples/winit_wrong_sized_buffer.rs | 2 +- src/wayland/buffer.rs | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index abd255a..6b88f83 100644 --- a/README.md +++ b/README.md @@ -10,15 +10,15 @@ example, it occasionally segfaults on some platforms and is missing key features icon. While it would be possible to add these features to minifb, it makes more sense to instead use the standard window handling systems. -swbuf integrates with the [raw-window-handle](https://crates.io/crates/raw-window-handle) crate +Softbuffer integrates with the [raw-window-handle](https://crates.io/crates/raw-window-handle) crate to allow writing to a window in a cross-platform way while using the very high quality dedicated window management libraries that are available in the Rust ecosystem. -What about [pixels](https://crates.io/crates/pixels)? Pixels accomplishes a very similar goal to swbuf, +What about [pixels](https://crates.io/crates/pixels)? Pixels accomplishes a very similar goal to Softbuffer, however there are two key differences. Pixels provides some capacity for GPU-accelerated post-processing of what is -displayed, while swbuf does not. Due to not having this post-processing, swbuf does not rely on the GPU or +displayed, while Softbuffer does not. Due to not having this post-processing, Softbuffer does not rely on the GPU or hardware accelerated graphics stack in any way, and is thus more portable to installations that do not have access to -hardware acceleration (e.g. VMs, older computers, computers with misconfigured drivers). swbuf should be used over +hardware acceleration (e.g. VMs, older computers, computers with misconfigured drivers). Softbuffer should be used over pixels when its GPU-accelerated post-processing effects are not needed. @@ -31,7 +31,7 @@ from the minifb library to do platform-specific work. Platform support: == Some, but not all, platforms supported in [raw-window-handle](https://crates.io/crates/raw-window-handle) are supported -by swbuf. Pull requests are welcome to add new platforms! **Nonetheless, all major desktop platforms that winit uses +by Softbuffer. Pull requests are welcome to add new platforms! **Nonetheless, all major desktop platforms that winit uses on desktop are supported.** For now, the priority for new platforms is: @@ -55,7 +55,7 @@ For now, the priority for new platforms is: Example == ```rust,no_run -use swbuf::GraphicsContext; +use Softbuffer::GraphicsContext; use winit::event::{Event, WindowEvent}; use winit::event_loop::{ControlFlow, EventLoop}; use winit::window::WindowBuilder; diff --git a/examples/animation.rs b/examples/animation.rs index 17635a3..601c936 100644 --- a/examples/animation.rs +++ b/examples/animation.rs @@ -2,7 +2,7 @@ use instant::Instant; #[cfg(not(target_arch = "wasm32"))] use rayon::prelude::*; use std::f64::consts::PI; -use swbuf::GraphicsContext; +use softbuffer::GraphicsContext; use winit::event::{Event, WindowEvent}; use winit::event_loop::{ControlFlow, EventLoop}; use winit::window::WindowBuilder; diff --git a/examples/fruit.rs b/examples/fruit.rs index bf97c25..790a17c 100644 --- a/examples/fruit.rs +++ b/examples/fruit.rs @@ -1,5 +1,5 @@ use image::GenericImageView; -use swbuf::GraphicsContext; +use softbuffer::GraphicsContext; use winit::event::{Event, WindowEvent}; use winit::event_loop::{ControlFlow, EventLoop}; use winit::window::WindowBuilder; diff --git a/examples/winit.rs b/examples/winit.rs index 286d2b4..c782219 100644 --- a/examples/winit.rs +++ b/examples/winit.rs @@ -1,4 +1,4 @@ -use swbuf::GraphicsContext; +use softbuffer::GraphicsContext; use winit::event::{Event, WindowEvent}; use winit::event_loop::{ControlFlow, EventLoop}; use winit::window::WindowBuilder; diff --git a/examples/winit_wrong_sized_buffer.rs b/examples/winit_wrong_sized_buffer.rs index 5699f4d..28f4c52 100644 --- a/examples/winit_wrong_sized_buffer.rs +++ b/examples/winit_wrong_sized_buffer.rs @@ -1,4 +1,4 @@ -use swbuf::GraphicsContext; +use softbuffer::GraphicsContext; use winit::event::{Event, WindowEvent}; use winit::event_loop::{ControlFlow, EventLoop}; use winit::window::WindowBuilder; diff --git a/src/wayland/buffer.rs b/src/wayland/buffer.rs index e2d4f5d..c078d89 100644 --- a/src/wayland/buffer.rs +++ b/src/wayland/buffer.rs @@ -28,7 +28,7 @@ pub(super) struct WaylandBuffer { impl WaylandBuffer { pub fn new(shm: &wl_shm::WlShm, width: i32, height: i32, qh: &QueueHandle) -> Self { - let name = unsafe { CStr::from_bytes_with_nul_unchecked("swbuf\0".as_bytes()) }; + let name = unsafe { CStr::from_bytes_with_nul_unchecked("softbuffer\0".as_bytes()) }; let tempfile_fd = memfd_create(name, MemFdCreateFlag::MFD_CLOEXEC) .expect("Failed to create memfd to store buffer."); let tempfile = unsafe { File::from_raw_fd(tempfile_fd) };