mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2024-12-24 03:41:29 +11:00
31 lines
557 B
Rust
31 lines
557 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 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
|
||
|
}
|