# GlVersion

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-opengl/struct-glversion/

**struct** · [`ferroui-opengl`](/docs/0.5.0/api/ferroui-opengl/) · v0.5.0

```rust
struct GlVersion
```

The version of the OpenGL API of a context.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.OpenGL/gl_version.rs#L11)

## Members

- [`new`](#function-new)
- [`with_compatibility_profile`](#function-with_compatibility_profile)
- [`type_`](#function-type_)
- [`major`](#function-major)
- [`minor`](#function-minor)
- [`is_compatibility_profile`](#function-is_compatibility_profile)

<a id="function-new"></a>

### new

```rust
const fn new(type_: GlProfileType, major: i32, minor: i32) -> Self
```

A version of the core profile.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.OpenGL/gl_version.rs#L20)

<a id="function-with_compatibility_profile"></a>

### with_compatibility_profile

```rust
const fn with_compatibility_profile(type_: GlProfileType, major: i32, minor: i32, is_compatibility_profile: bool) -> Self
```

A version with an explicit choice of the compatibility profile.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.OpenGL/gl_version.rs#L25)

<a id="function-type_"></a>

### type_

```rust
const fn type_(self: &Self) -> GlProfileType
```

The flavour of the API.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.OpenGL/gl_version.rs#L35)

<a id="function-major"></a>

### major

```rust
const fn major(self: &Self) -> i32
```

The major version.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.OpenGL/gl_version.rs#L40)

<a id="function-minor"></a>

### minor

```rust
const fn minor(self: &Self) -> i32
```

The minor version.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.OpenGL/gl_version.rs#L45)

<a id="function-is_compatibility_profile"></a>

### is_compatibility_profile

```rust
const fn is_compatibility_profile(self: &Self) -> bool
```

Whether the compatibility profile is requested. Only makes sense if
the type is OpenGL and the version is at least 3.2.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.OpenGL/gl_version.rs#L51)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`ResourceKeyObject`](/docs/0.5.0/api/ferroui-base/controls/trait-resourcekeyobject/)
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Hash`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
