backend: Add a winit backend for testing
This commit is contained in:
parent
370c825c8e
commit
c46f327384
5 changed files with 853 additions and 17 deletions
13
src/state.rs
13
src/state.rs
|
|
@ -1,7 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use crate::{
|
||||
backend::x11::X11State,
|
||||
backend::{
|
||||
x11::X11State,
|
||||
winit::WinitState,
|
||||
},
|
||||
shell::{init_shell, workspaces::Workspaces, ShellStates},
|
||||
};
|
||||
use smithay::{
|
||||
|
|
@ -59,6 +62,7 @@ pub struct Fps {
|
|||
|
||||
pub enum BackendData {
|
||||
X11(X11State),
|
||||
Winit(WinitState),
|
||||
// TODO
|
||||
// Wayland(WaylandState),
|
||||
// Udev(UdevState),
|
||||
|
|
@ -72,6 +76,13 @@ impl BackendData {
|
|||
_ => unreachable!("Called x11 in non x11 backend"),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn winit(&mut self) -> &mut WinitState {
|
||||
match self {
|
||||
BackendData::Winit(ref mut winit_state) => winit_state,
|
||||
_ => unreachable!("Called winit in non winit backend"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl State {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue