surfman/platform/generic/multi/mod.rs
1// surfman/surfman/src/platform/generic/multi/mod.rs
2//
3//! An abstraction that allows the choice of backends dynamically.
4//!
5//! This is useful on Unix systems, because it allows for Wayland to be tried first, and, failing
6//! that, to use X11.
7//!
8//! Each type here has two type parameters: a "default" device and an "alternate" device. Opening a
9//! connection will first attempt to open the default connection and, if that fails, attempts to
10//! open the alternate connection. You can also create instances of these types manually (i.e.
11//! wrapping a default or alternate type directly) if you have platform-specific initialization
12//! code.
13//!
14//! You can "daisy chain" these types to switch between more than two backends. For example, you
15//! might use `multi::Device<wayland::Device, multi::Device<x11::Device, osmesa::Device>>` for a
16//! device that can dynamically switch between Wayland, X11, and OSMesa.
17
18pub mod connection;
19pub mod context;
20pub mod device;
21pub mod surface;