aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.rs
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-02-19 21:55:15 +0100
committertomaka <pierre.krieger1708@gmail.com>2015-02-19 21:55:15 +0100
commit8e1d0f7a976078ef7031ff84e077f00655d4e061 (patch)
treee03c5d40096b2545fe02fed2ec4668a3872cc3cd /src/window.rs
parent95d70ce549f776794a89c6c83d1df707b914ab8f (diff)
parentf4f84c6566d99c297cddee3c712e94927f313204 (diff)
downloadglutin-8e1d0f7a976078ef7031ff84e077f00655d4e061.tar.gz
glutin-8e1d0f7a976078ef7031ff84e077f00655d4e061.zip
Merge pull request #282 from tomaka/gl-api
Improve the OpenGL context request system
Diffstat (limited to 'src/window.rs')
-rw-r--r--src/window.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/window.rs b/src/window.rs
index a830733..c916b27 100644
--- a/src/window.rs
+++ b/src/window.rs
@@ -5,6 +5,7 @@ use Api;
use BuilderAttribs;
use CreationError;
use Event;
+use GlRequest;
use MouseCursor;
use gl_common;
@@ -56,12 +57,16 @@ impl<'a> WindowBuilder<'a> {
self
}
- /// Requests to use a specific OpenGL version.
- ///
- /// Version is a (major, minor) pair. For example to request OpenGL 3.3
- /// you would pass `(3, 3)`.
+ /// THIS FUNCTION IS DEPRECATED
+ #[deprecated = "Use with_gl instead"]
pub fn with_gl_version(mut self, version: (u32, u32)) -> WindowBuilder<'a> {
- self.attribs.gl_version = Some(version);
+ self.attribs.gl_version = GlRequest::Specific(::Api::OpenGl, (version.0 as u8, version.1 as u8));
+ self
+ }
+
+ /// Sets how the backend should choose the OpenGL API and version.
+ pub fn with_gl(mut self, request: GlRequest) -> WindowBuilder<'a> {
+ self.attribs.gl_version = request;
self
}