Struct gfx_device_gl::Version
[−]
[src]
pub struct Version { pub major: u32, pub minor: u32, pub revision: Option<u32>, pub vendor_info: &'static str, }
A version number for a specific component of an OpenGL implementation
Fields
major | |
minor | |
revision | |
vendor_info |
Methods
impl Version
fn new(major: u32, minor: u32, revision: Option<u32>, vendor_info: &'static str) -> Version
Create a new OpenGL version number
fn parse(src: &'static str) -> Result<Version, &'static str>
According to the OpenGL specification, the version information is expected to follow the following syntax:
<major> ::= <number>
<minor> ::= <number>
<revision> ::= <number>
<vendor-info> ::= <string>
<release> ::= <major> "." <minor> ["." <release>]
<version> ::= <release> [" " <vendor-info>]
Note that this function is intentionally lenient in regards to parsing,
and will try to recover at least the first two version numbers without
resulting in an Err
.