Commit 69515114 authored by Jeremy Soller's avatar Jeremy Soller

Add support for borderless window flag

parent 151331bc
......@@ -31,6 +31,7 @@ pub enum WindowFlag {
Async,
Back,
Front,
Borderless,
Resizable,
Unclosable
}
......
......@@ -104,6 +104,7 @@ impl Window {
},
WindowFlag::Back => flag_str.push('b'),
WindowFlag::Front => flag_str.push('f'),
WindowFlag::Borderless => flag_str.push('l'),
WindowFlag::Resizable => {
resizable = true;
flag_str.push('r');
......
......@@ -107,21 +107,30 @@ impl Window {
unsafe { init() };
let mut async = false;
//TODO: Use z-order
let mut _back = false;
let mut _front = false;
let mut borderless = false;
let mut resizable = false;
//TODO: Hide exit button
let mut _unclosable = false;
for &flag in flags.iter() {
match flag {
WindowFlag::Async => async = true,
WindowFlag::Back => _back = true,
WindowFlag::Front => _front = true,
WindowFlag::Borderless => borderless = true,
WindowFlag::Resizable => resizable = true,
WindowFlag::Unclosable => _unclosable = true,
//TODO: Handle front and back zorder
_ => ()
}
}
let mut builder = unsafe { & *VIDEO_CTX }.window(title, w, h);
if borderless {
builder.borderless();
}
if resizable {
builder.resizable();
}
......@@ -130,10 +139,6 @@ impl Window {
builder.position(x, y);
}
if title.is_empty() {
builder.borderless();
}
match builder.build() {
Ok(window) => Some(Window {
x: x,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment