pub struct Version {
pub major: u32,
pub minor: u32,
pub is_embedded: bool,
pub revision: Option<u32>,
pub vendor_info: String,
}
Expand description
A version number for a specific component of an OpenGL implementation
Fields§
§major: u32
§minor: u32
§is_embedded: bool
§revision: Option<u32>
§vendor_info: String
Implementations§
source§impl Version
impl Version
sourcepub(crate) fn new(
major: u32,
minor: u32,
revision: Option<u32>,
vendor_info: String
) -> Self
pub(crate) fn new( major: u32, minor: u32, revision: Option<u32>, vendor_info: String ) -> Self
Create a new OpenGL version number
sourcepub(crate) fn new_embedded(major: u32, minor: u32, vendor_info: String) -> Self
pub(crate) fn new_embedded(major: u32, minor: u32, vendor_info: String) -> Self
Create a new OpenGL ES version number
sourcepub(crate) fn parse(src: &str) -> Result<Version, &str>
pub(crate) fn parse(src: &str) -> Result<Version, &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
.
Notes
WebGL 2
version returned as OpenGL ES 3.0
Trait Implementations§
source§impl Ord for Version
impl Ord for Version
source§impl PartialEq<Version> for Version
impl PartialEq<Version> for Version
source§impl PartialOrd<Version> for Version
impl PartialOrd<Version> for Version
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more