-
-
Notifications
You must be signed in to change notification settings - Fork 477
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
Conversation
There was a problem hiding this 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. |
There was a problem hiding this comment.
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`. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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, | ||
); |
There was a problem hiding this comment.
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, | ||
); |
There was a problem hiding this comment.
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(), | ||
)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: formating?
Merry Christmas. Closing this PR due to inactivity. Cheers! |
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.