diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2015-09-21 14:15:41 +0200 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2015-09-21 14:15:41 +0200 |
commit | 6787f1d43493f0f8c2310ac3c3d5cb409d13ec40 (patch) | |
tree | 03056bc49bd5ec0da9e155176a74c2d23a8fc603 /src/api/win32/mod.rs | |
parent | f51ace4c7885fa25c146c24181c4d87f5632de3e (diff) | |
parent | 62bafe2130db5aaf32bd46091581086ae435e4cf (diff) | |
download | glutin-6787f1d43493f0f8c2310ac3c3d5cb409d13ec40.tar.gz glutin-6787f1d43493f0f8c2310ac3c3d5cb409d13ec40.zip |
Merge pull request #603 from tomaka/gl-attribs
Separate the builder attributes into multiple substates
Diffstat (limited to 'src/api/win32/mod.rs')
-rw-r--r-- | src/api/win32/mod.rs | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/api/win32/mod.rs b/src/api/win32/mod.rs index dea6357..f580950 100644 --- a/src/api/win32/mod.rs +++ b/src/api/win32/mod.rs @@ -13,11 +13,13 @@ use libc; use ContextError; use {CreationError, Event, MouseCursor}; use CursorState; +use GlAttributes; use GlContext; use Api; use PixelFormat; -use BuilderAttribs; +use PixelFormatRequirements; +use WindowAttributes; pub use self::monitor::{MonitorID, get_available_monitors, get_primary_monitor}; @@ -83,15 +85,18 @@ impl WindowProxy { impl Window { /// See the docs in the crate root file. - pub fn new(builder: BuilderAttribs, egl: Option<&Egl>) -> Result<Window, CreationError> { - let (builder, sharing) = builder.extract_non_static(); - - let sharing = sharing.map(|w| match w.context { - Context::Wgl(ref c) => RawContext::Wgl(c.get_hglrc()), - Context::Egl(_) => unimplemented!(), // FIXME: + pub fn new(window: &WindowAttributes, pf_reqs: &PixelFormatRequirements, + opengl: &GlAttributes<&Window>, egl: Option<&Egl>) + -> Result<Window, CreationError> + { + let opengl = opengl.clone().map_sharing(|sharing| { + match sharing.context { + Context::Wgl(ref c) => RawContext::Wgl(c.get_hglrc()), + Context::Egl(_) => unimplemented!(), // FIXME: + } }); - init::new_window(builder, sharing, egl) + init::new_window(window, pf_reqs, &opengl, egl) } /// See the docs in the crate root file. |