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

Changed type of vsync from bool to Option<bool> #1230

Closed
wants to merge 1 commit into from

Conversation

Tacklebox
Copy link

Hi,

This is to address issue #631

I am not really sure about glutin/src/api/egl/mod.rs line 1089, if the Option is none, should it be treated as if the bool was false? The comment // VSync defaults to enabled; disable it if it was not requested. seems to be at odds with the ones in lib.rs `/// By default, vsync is not enabled.

Copy link
Contributor

@goddessfreya goddessfreya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please resolve these issues.

Please implement it for the other platforms.

Please update the example code at src/context.rs:24:17.

@@ -181,7 +181,7 @@ impl<'a, T: ContextCurrentState> ContextBuilder<'a, T> {
///
/// By default, vsync is not enabled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs should be updated to say that None equals don't care.

@@ -705,7 +705,7 @@ pub struct GlAttributes<S> {
/// screen tearing.
///
/// The default is `false`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs should be updated to say that None equals don't care.

@@ -1086,19 +1086,21 @@ impl<'a> ContextPrototype<'a> {

if let Some(surface) = surface {
// VSync defaults to enabled; disable it if it was not requested.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EGL by default has VSync enabled, and you have to explicitly disable it. Hope that makes sense.

@@ -1294,8 +1296,12 @@ where
}

// We're interested in those configs which allow our desired VSync.
let desired_swap_interval = if opengl.vsync {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code as it exists contradicts the prior code. The prior code does not disable vsync when None is received, yet sets the desired_swap_interval to 0 (no vsync).

If we don't care about VSync, then it doesn't matter what the MIN_SWAP_INTERVAL/MAX_SWAP_INTERVAL equals, so we don't even need the filter.

self.xconn.display as *mut _,
window,
1,
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: formating?

window,
ffi::glx_extra::SWAP_INTERVAL_EXT as i32,
&mut swap,
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: formating?

} else {
return Err(CreationError::OsError(
"Couldn't find any available vsync extension".to_string(),
));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: formating?

@goddessfreya
Copy link
Contributor

Merry Christmas. Closing this PR due to inactivity. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants