aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.rs
diff options
context:
space:
mode:
authorPierre Krieger <pierre.krieger1708@gmail.com>2015-09-21 09:15:53 +0200
committerPierre Krieger <pierre.krieger1708@gmail.com>2015-09-21 12:03:55 +0200
commit48fe9b26442662517b1590cb98ab81d79b059953 (patch)
treee2043b1941d340090fa7c7e9590bf2f3e7c81b47 /src/window.rs
parentc244f8c033f100a6e0f3e0b2b408f6ddc1006d47 (diff)
downloadglutin-48fe9b26442662517b1590cb98ab81d79b059953.tar.gz
glutin-48fe9b26442662517b1590cb98ab81d79b059953.zip
Extract WindowAttributes from the BuilderAttribs
Diffstat (limited to 'src/window.rs')
-rw-r--r--src/window.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/window.rs b/src/window.rs
index afca319..4a45a01 100644
--- a/src/window.rs
+++ b/src/window.rs
@@ -37,13 +37,13 @@ impl<'a> WindowBuilder<'a> {
///
/// Width and height are in pixels.
pub fn with_dimensions(mut self, width: u32, height: u32) -> WindowBuilder<'a> {
- self.attribs.dimensions = Some((width, height));
+ self.attribs.window.dimensions = Some((width, height));
self
}
/// Requests a specific title for the window.
pub fn with_title(mut self, title: String) -> WindowBuilder<'a> {
- self.attribs.title = title;
+ self.attribs.window.title = title;
self
}
@@ -52,7 +52,7 @@ impl<'a> WindowBuilder<'a> {
/// If you don't specify dimensions for the window, it will match the monitor's.
pub fn with_fullscreen(mut self, monitor: MonitorID) -> WindowBuilder<'a> {
let MonitorID(monitor) = monitor;
- self.attribs.monitor = Some(monitor);
+ self.attribs.window.monitor = Some(monitor);
self
}
@@ -99,7 +99,7 @@ impl<'a> WindowBuilder<'a> {
/// Sets whether the window will be initially hidden or visible.
pub fn with_visibility(mut self, visible: bool) -> WindowBuilder<'a> {
- self.attribs.visible = visible;
+ self.attribs.window.visible = visible;
self
}
@@ -147,19 +147,19 @@ impl<'a> WindowBuilder<'a> {
/// Sets whether the background of the window should be transparent.
pub fn with_transparency(mut self, transparent: bool) -> WindowBuilder<'a> {
- self.attribs.transparent = transparent;
+ self.attribs.window.transparent = transparent;
self
}
/// Sets whether the window should have a border, a title bar, etc.
pub fn with_decorations(mut self, decorations: bool) -> WindowBuilder<'a> {
- self.attribs.decorations = decorations;
+ self.attribs.window.decorations = decorations;
self
}
/// Enables multitouch
pub fn with_multitouch(mut self) -> WindowBuilder<'a> {
- self.attribs.multitouch = true;
+ self.attribs.window.multitouch = true;
self
}
@@ -169,13 +169,13 @@ impl<'a> WindowBuilder<'a> {
/// out of memory, etc.
pub fn build(mut self) -> Result<Window, CreationError> {
// resizing the window to the dimensions of the monitor when fullscreen
- if self.attribs.dimensions.is_none() && self.attribs.monitor.is_some() {
- self.attribs.dimensions = Some(self.attribs.monitor.as_ref().unwrap().get_dimensions())
+ if self.attribs.window.dimensions.is_none() && self.attribs.window.monitor.is_some() {
+ self.attribs.window.dimensions = Some(self.attribs.window.monitor.as_ref().unwrap().get_dimensions())
}
// default dimensions
- if self.attribs.dimensions.is_none() {
- self.attribs.dimensions = Some((1024, 768));
+ if self.attribs.window.dimensions.is_none() {
+ self.attribs.window.dimensions = Some((1024, 768));
}
// building