diff options
author | Tomaka17 <pierre.krieger1708@gmail.com> | 2014-11-05 15:23:20 +0100 |
---|---|---|
committer | Tomaka17 <pierre.krieger1708@gmail.com> | 2014-11-05 15:23:20 +0100 |
commit | 2e44edea60a19919be467a1228ae971e7b988fec (patch) | |
tree | 0b8d9233e9ee28e574f7a6bb462daa9e3fb56133 /src/win32 | |
parent | 4c674ef8437ba921f6e95a882a644bdcb1b8e235 (diff) | |
parent | a69c2209a58e2fb1354aae1c6e45cc5f555669cc (diff) | |
download | glutin-2e44edea60a19919be467a1228ae971e7b988fec.tar.gz glutin-2e44edea60a19919be467a1228ae971e7b988fec.zip |
Merge branch 'master' of http://github.com/tomaka/gl-init-rs
Diffstat (limited to 'src/win32')
-rw-r--r-- | src/win32/init.rs | 4 | ||||
-rw-r--r-- | src/win32/mod.rs | 16 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/win32/init.rs b/src/win32/init.rs index 5168cc6..bf84973 100644 --- a/src/win32/init.rs +++ b/src/win32/init.rs @@ -17,7 +17,7 @@ local_data_key!(WINDOW: (ffi::HWND, Sender<Event>)) pub fn new_window(builder_dimensions: Option<(uint, uint)>, builder_title: String, builder_monitor: Option<super::MonitorID>, builder_gl_version: Option<(uint, uint)>, builder_vsync: bool, - builder_headless: bool) -> Result<Window, String> + builder_hidden: bool) -> Result<Window, String> { use std::mem; use std::os; @@ -237,7 +237,7 @@ pub fn new_window(builder_dimensions: Option<(uint, uint)>, builder_title: Strin (None, None) }; - let style = if builder_headless { + let style = if builder_hidden { style } else { style | ffi::WS_VISIBLE diff --git a/src/win32/mod.rs b/src/win32/mod.rs index 35e7169..facfb6d 100644 --- a/src/win32/mod.rs +++ b/src/win32/mod.rs @@ -68,8 +68,8 @@ pub struct Window { impl Window { /// See the docs in the crate root file. pub fn new(builder: WindowBuilder) -> Result<Window, String> { - let WindowBuilder { dimensions, title, monitor, gl_version, vsync } = builder; - init::new_window(dimensions, title, monitor, gl_version, vsync, false) + let WindowBuilder { dimensions, title, monitor, gl_version, vsync, visible } = builder; + init::new_window(dimensions, title, monitor, gl_version, vsync, !visible) } } @@ -91,6 +91,18 @@ impl Window { } } + pub fn show(&self) { + unsafe { + ffi::ShowWindow(self.window, ffi::SW_SHOW); + } + } + + pub fn hide(&self) { + unsafe { + ffi::ShowWindow(self.window, ffi::SW_HIDE); + } + } + /// See the docs in the crate root file. pub fn get_position(&self) -> Option<(int, int)> { use std::mem; |