4d5d7afb5a
This pulls a lot of code from anvil/src/glium_drawer and replaces glium as glium has too many assumptions about the backend. (Mostly that a fixed framebuffer exists, see fix bullet point.) Depending on how picky glium is, we could try to re-introduce glium support later with a some workarounds, but for now this is actually more straight-forward to support and test. - Add a new GL renderer, that only depends on egl as an initialization platform. In particular do not depend on a surface being available. Renderers share some basic drawing functions and may bind objects to render upon. E.g. surfaces or buffers, textures, etc for the gles2 renderer. - Be explicit about extensions we require and use. Use some very very common ones to make our lives easier (e.g. BGRA and unpack to read in manditory shm formats). - Enable GL debug output - Allow more flexible rendering (e.g. 3D compositors) by allowing user-provided projection matrices. Also provide helper functions to allow easy-ish handling of surface and output transformations. - Add API for renderers to tell the wayland-frontend about supported buffer-types. - Also incoperate code from anvil/src/shm_load to handle buffer loading in the renderer (as this is a renderer dependant operation). |
||
---|---|---|
.github/workflows | ||
anvil | ||
examples | ||
src | ||
.gitignore | ||
.rustfmt.toml | ||
CHANGELOG.md | ||
CONTRIBUTING.md | ||
Cargo.toml | ||
LICENSE.txt | ||
README.md | ||
build.rs | ||
doc_index.html | ||
matrix_badge.svg |
README.md
Smithay
A smithy for rusty wayland compositors
Goals
Smithay aims to provide building blocks to create wayland compositors in Rust. While not being a full-blown compositor, it'll provide objects and interfaces implementing common functionalities that pretty much any compositor will need, in a generic fashion.
Also:
- Documented: Smithay strives to maintain a clear and detailed documentation of its API and its functionalities. Compiled documentations are available on docs.rs for released versions, and here for the master branch.
- Safety: Smithay will target to be safe to use, because Rust.
- Modularity: Smithay is not a framework, and will not be constraining. If there is a part you don't want to use, you should not be forced to use it.
- High-level: You should be able to not have to worry about gory low-level stuff (but Smithay won't stop you if you really want to dive into it).
Anvil
Like others, Smithay as a compositor library has its own sample compositor: anvil.
You can run it with cargo after having cloned this repository:
cd anvil;
cargo run -- --{backend}
The currently available backends are:
-
--winit
: start anvil as a Winit application. This allows you to run it inside of an other X11 or Wayland session. -
--tty-udev
: start anvil in a tty with udev support. This is the "traditional" launch of a Wayland compositor. Note that this requires you to start anvil as root if your system does not have logind available (consolekit support is planned). To use logind, you need to activate the associated cargo feature:cargo run --features logind -- --tty-udev