Add support for specific OpenGL version for Win32
This commit is contained in:
parent
13c73cce5e
commit
8c074af9fc
3 changed files with 34 additions and 4 deletions
11
src/lib.rs
11
src/lib.rs
|
|
@ -29,6 +29,7 @@ pub struct WindowBuilder {
|
|||
dimensions: (uint, uint),
|
||||
title: String,
|
||||
monitor: Option<winimpl::MonitorID>,
|
||||
gl_version: Option<(uint, uint)>,
|
||||
}
|
||||
|
||||
impl WindowBuilder {
|
||||
|
|
@ -38,6 +39,7 @@ impl WindowBuilder {
|
|||
dimensions: (1024, 768),
|
||||
title: String::new(),
|
||||
monitor: None,
|
||||
gl_version: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -57,6 +59,15 @@ impl WindowBuilder {
|
|||
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)`.
|
||||
pub fn with_gl_version(mut self, version: (uint, uint)) -> WindowBuilder {
|
||||
self.gl_version = Some(version);
|
||||
self
|
||||
}
|
||||
|
||||
/// Builds the window.
|
||||
///
|
||||
/// Error should be very rare and only occur in case of permission denied, incompatible system,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue