Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glutin version 0.31.2 #1660

Merged
merged 3 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Unreleased

# Version 0.31.2

- Fixed EGL not setting context version with EGL versions before 1.5 and missing context ext.

# Version 0.31.1

- Fixed `CGLContextObj` having an invalid encoding on newer macOS versions.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A low-level library for OpenGL context creation.

```toml
[dependencies]
glutin = "0.31.1"
glutin = "0.31.2"
```

## [Documentation](https://docs.rs/glutin)
Expand Down
2 changes: 1 addition & 1 deletion glutin-winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ edition = "2021"
[features]
default = ["egl", "glx", "x11", "wayland", "wgl"]
egl = ["glutin/egl"]
glx = ["glutin/glx", "glutin/x11", "winit/x11", "x11"]
glx = ["glutin/glx", "x11"]
wgl = ["glutin/wgl"]
x11 = ["glutin/x11", "winit/x11"]
wayland = ["glutin/wayland", "winit/wayland"]
Expand Down
6 changes: 3 additions & 3 deletions glutin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "glutin"
version = "0.31.1"
version = "0.31.2"
authors = ["Kirill Chibisov <[email protected]>"]
description = "Cross-platform OpenGL context provider."
keywords = ["windowing", "opengl", "egl"]
Expand All @@ -14,10 +14,10 @@ edition = "2021"
[features]
default = ["egl", "glx", "x11", "wayland", "wgl"]
egl = ["glutin_egl_sys", "libloading"]
glx = ["x11", "x11-dl", "glutin_glx_sys", "libloading"]
glx = ["x11", "glutin_glx_sys", "libloading"]
wgl = ["glutin_wgl_sys", "windows-sys"]
x11 = ["x11-dl"]
wayland = ["wayland-sys"]
wayland = ["wayland-sys", "egl"]

[dependencies]
bitflags = "2.2.1"
Expand Down
2 changes: 1 addition & 1 deletion glutin/src/api/egl/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ impl GetGlDisplay for Config {
type Target = Display;

fn display(&self) -> Self::Target {
Display { inner: self.inner.display.inner.clone() }
self.inner.display.clone()
}
}

Expand Down
7 changes: 7 additions & 0 deletions glutin/src/api/egl/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ impl Display {
attrs.push(egl::CONTEXT_FLAGS_KHR as EGLint);
attrs.push(flags as EGLint);
}
} else if self.inner.version >= Version::new(1, 3) {
// EGL 1.3 uses that to indicate client version instead of major/minor. The
// constant is the same as `CONTEXT_MAJOR_VERSION`.
if let Some(version) = version {
attrs.push(egl::CONTEXT_CLIENT_VERSION as EGLint);
attrs.push(version.major as EGLint);
}
}

attrs.push(egl::NONE as EGLint);
Expand Down
4 changes: 2 additions & 2 deletions glutin/src/api/egl/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Display {
/// # Safety
///
/// `raw_display` must point to a valid system display. Using zero or
/// `[std::ptr::null]` for the display will result in using
/// [`std::ptr::null()`] for the display will result in using
/// `EGL_DEFAULT_DISPLAY`, which is not recommended or will
/// work on a platform with a concept of native display, like Wayland.
pub unsafe fn new(raw_display: RawDisplayHandle) -> Result<Self> {
Expand Down Expand Up @@ -80,7 +80,7 @@ impl Display {

/// Create an EGL display using the specified device.
///
/// In most cases, prefer [`Display::new`] unless you need to render
/// In most cases, prefer [`Display::new()`] unless you need to render
/// off screen or use other extensions like EGLStreams.
///
/// This function may take an optional [`RawDisplayHandle`] argument. At the
Expand Down
4 changes: 2 additions & 2 deletions glutin/src/api/glx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ pub mod surface;
/// The hook registrar must call to the function inside xlib error
/// [`handler`].
///
/// The `bool` value returned by that hook tells wether the error was handled by
/// it or not. So when it returns `true` it means that your error handling
/// The `bool` value returned by that hook tells whether the error was handled
/// by it or not. So when it returns `true` it means that your error handling
/// routine shouldn't handle the error as it was handled by the hook already.
///
/// [`handler`]: https://tronche.com/gui/x/xlib/event-handling/protocol-errors/XSetErrorHandler.html
Expand Down
10 changes: 5 additions & 5 deletions glutin/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl ConfigTemplateBuilder {
self
}

/// Wether the floating pixel formats should be used.
/// Whether the floating pixel formats should be used.
///
/// By default `false` is requested.
#[inline]
Expand Down Expand Up @@ -181,7 +181,7 @@ impl ConfigTemplateBuilder {
self
}

/// Wether the stereo pairs should be present.
/// Whether the stereo pairs should be present.
///
/// By default it isn't specified.
#[inline]
Expand All @@ -190,7 +190,7 @@ impl ConfigTemplateBuilder {
self
}

/// Wether the single buffer should be used.
/// Whether the single buffer should be used.
///
/// By default `false` is requested.
#[inline]
Expand All @@ -199,7 +199,7 @@ impl ConfigTemplateBuilder {
self
}

/// Wether the configuration should support transparency.
/// Whether the configuration should support transparency.
///
/// The default is `false`.
///
Expand All @@ -221,7 +221,7 @@ impl ConfigTemplateBuilder {
self
}

/// Wether the configuration should prefer hardware accelerated formats or
/// Whether the configuration should prefer hardware accelerated formats or
/// not.
///
/// By default hardware acceleration or its absence is not requested.
Expand Down
2 changes: 1 addition & 1 deletion glutin/src/surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ impl<T: SurfaceTypeTrait> Sealed for Surface<T> {}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SwapInterval {
/// When this variant is used calling
/// `[crate::surface::GlSurface::swap_buffers]` will not block.
/// [`crate::surface::GlSurface::swap_buffers()`] will not block.
DontWait,

/// The swap is synchronized to the `n`'th video frame. This is typically
Expand Down
10 changes: 5 additions & 5 deletions glutin_examples/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ pub mod gl {
}

pub fn main(event_loop: winit::event_loop::EventLoop<()>) -> Result<(), Box<dyn Error>> {
// Only windows requires the window to be present before creating the display.
// Only Windows requires the window to be present before creating the display.
// Other platforms don't really need one.
//
// XXX if you don't care about running on android or so you can safely remove
// XXX if you don't care about running on Android or so you can safely remove
// this condition and always pass the window builder.
let window_builder =
if cfg!(wgl_backend) { Some(WindowBuilder::new().with_transparent(true)) } else { None };
Expand Down Expand Up @@ -65,8 +65,8 @@ pub fn main(event_loop: winit::event_loop::EventLoop<()>) -> Result<(), Box<dyn

let raw_window_handle = window.as_ref().map(|window| window.raw_window_handle());

// XXX The display could be obtained from the any object created by it, so we
// can query it from the config.
// XXX The display could be obtained from any object created by it, so we can
// query it from the config.
let gl_display = gl_config.display();

// The context creation part. It can be created before surface and that's how
Expand Down Expand Up @@ -112,7 +112,7 @@ pub fn main(event_loop: winit::event_loop::EventLoop<()>) -> Result<(), Box<dyn
.unwrap()
});

let attrs = window.build_surface_attributes(<_>::default());
let attrs = window.build_surface_attributes(Default::default());
let gl_surface = unsafe {
gl_config.display().create_window_surface(&gl_config, &attrs).unwrap()
};
Expand Down
Loading