1
0
Fork 0
forked from wry/wry

config: allow retrieving the modes

This commit is contained in:
Julian Orth 2024-03-04 16:09:53 +01:00
parent 2ab7b43f74
commit 558bea47b7
8 changed files with 73 additions and 3 deletions

View file

@ -2,7 +2,12 @@ pub mod client;
pub mod ipc;
mod logging;
use {bincode::Options, std::marker::PhantomData};
use {
crate::video::Mode,
bincode::Options,
serde::{Deserialize, Serialize},
std::marker::PhantomData,
};
pub const VERSION: u32 = 1;
@ -36,3 +41,20 @@ pub fn bincode_ops() -> impl Options {
pub trait Config {
extern "C" fn configure();
}
#[derive(Serialize, Deserialize, Debug)]
pub struct WireMode {
pub width: i32,
pub height: i32,
pub refresh_millihz: u32,
}
impl WireMode {
pub fn to_mode(self) -> Mode {
Mode {
width: self.width,
height: self.height,
refresh_millihz: self.refresh_millihz,
}
}
}