rust_minifb/src/window_flags.rs
Antonino Siena 51bdfcc5ca Moved codebase to edition 2018 (#127)
* Moved to Rust edition 2018

* Changed redox code as well

* Undo typo

* Another correction
2019-12-30 19:34:27 +01:00

31 lines
561 B
Rust

#[allow(dead_code)]
const WINDOW_BORDERLESS: u32 = 1 << 1;
#[allow(dead_code)]
const WINDOW_RESIZE: u32 = 1 << 2;
#[allow(dead_code)]
const WINDOW_TITLE: u32 = 1 << 3;
use crate::WindowOptions;
//
// Construct a bitmask of flags (sent to backends) from WindowOpts
//
#[allow(dead_code)]
pub fn get_flags(opts: WindowOptions) -> u32 {
let mut flags = 0u32;
if opts.borderless {
flags |= WINDOW_BORDERLESS;
}
if opts.title {
flags |= WINDOW_TITLE;
}
if opts.resize {
flags |= WINDOW_RESIZE;
}
flags
}