diff options
author | Pierre Krieger <pierre.krieger1708@gmail.com> | 2015-09-20 09:29:22 +0200 |
---|---|---|
committer | Pierre Krieger <pierre.krieger1708@gmail.com> | 2015-09-21 12:03:55 +0200 |
commit | c244f8c033f100a6e0f3e0b2b408f6ddc1006d47 (patch) | |
tree | 786cb96254b0fe69646700fc4845218c5703ffac /src/api/glx | |
parent | f51ace4c7885fa25c146c24181c4d87f5632de3e (diff) | |
download | glutin-c244f8c033f100a6e0f3e0b2b408f6ddc1006d47.tar.gz glutin-c244f8c033f100a6e0f3e0b2b408f6ddc1006d47.zip |
Extract GlAttributes from BuilderAttribs
Diffstat (limited to 'src/api/glx')
-rw-r--r-- | src/api/glx/mod.rs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/api/glx/mod.rs b/src/api/glx/mod.rs index a1ee092..6a4461c 100644 --- a/src/api/glx/mod.rs +++ b/src/api/glx/mod.rs @@ -133,7 +133,7 @@ impl<'a> ContextPrototype<'a> { } pub fn finish(self, window: ffi::Window) -> Result<Context, CreationError> { - let share = if let Some(win) = self.builder.sharing { + let share = if let Some(win) = self.builder.opengl.sharing { match win { &PlatformWindow::X(ref win) => match win.x.context { ::api::x11::Context::Glx(ref c) => c.context, @@ -160,46 +160,46 @@ impl<'a> ContextPrototype<'a> { }); // creating GL context - let context = match self.builder.gl_version { + let context = match self.builder.opengl.version { GlRequest::Latest => { if let Ok(ctxt) = create_context(&self.glx, &extra_functions, &extensions, (3, 2), - self.builder.gl_profile, self.builder.gl_debug, - self.builder.gl_robustness, share, + self.builder.opengl.profile, self.builder.opengl.debug, + self.builder.opengl.robustness, share, self.display, self.fb_config, &self.visual_infos) { ctxt } else if let Ok(ctxt) = create_context(&self.glx, &extra_functions, &extensions, - (3, 1), self.builder.gl_profile, - self.builder.gl_debug, - self.builder.gl_robustness, share, self.display, + (3, 1), self.builder.opengl.profile, + self.builder.opengl.debug, + self.builder.opengl.robustness, share, self.display, self.fb_config, &self.visual_infos) { ctxt } else { try!(create_context(&self.glx, &extra_functions, &extensions, (1, 0), - self.builder.gl_profile, self.builder.gl_debug, - self.builder.gl_robustness, + self.builder.opengl.profile, self.builder.opengl.debug, + self.builder.opengl.robustness, share, self.display, self.fb_config, &self.visual_infos)) } }, GlRequest::Specific(Api::OpenGl, (major, minor)) => { try!(create_context(&self.glx, &extra_functions, &extensions, (major, minor), - self.builder.gl_profile, self.builder.gl_debug, - self.builder.gl_robustness, share, self.display, self.fb_config, + self.builder.opengl.profile, self.builder.opengl.debug, + self.builder.opengl.robustness, share, self.display, self.fb_config, &self.visual_infos)) }, GlRequest::Specific(_, _) => panic!("Only OpenGL is supported"), GlRequest::GlThenGles { opengl_version: (major, minor), .. } => { try!(create_context(&self.glx, &extra_functions, &extensions, (major, minor), - self.builder.gl_profile, self.builder.gl_debug, - self.builder.gl_robustness, share, self.display, self.fb_config, + self.builder.opengl.profile, self.builder.opengl.debug, + self.builder.opengl.robustness, share, self.display, self.fb_config, &self.visual_infos)) }, }; // vsync - if self.builder.vsync { + if self.builder.opengl.vsync { unsafe { self.glx.MakeCurrent(self.display as *mut _, window, context) }; if extra_functions.SwapIntervalEXT.is_loaded() { |