Allow skipping pixel-format OpenGL profile attributes#1747
Conversation
|
@kchibisov This makes minimal changes to the behavor and preserves the original behavior of when nothing is specified. Maybe just a thought for the future. From what I can tell, there is no reason for the profile selection not being inside the glutin/glutin/src/api/cgl/context.rs Line 53 in e2f87ad Is there a reason that it is currently inside the |
f8f56e3 to
e95fe97
Compare
|
I tested it and it now works on macOS, in addition to the existing unchanged platforms. |
|
I think there was some macOS specific reason for that, but I can not recall it. Moving it and align with other platforms would have been better, in my opinion. Maybe something related to send/sync or some OpenGL quirks macOS have given that apple considers it legacy. Would suggest to just browse git history, could be a reason for, since I think it was like that with even original glutin design. |
From what I can tell it should work. The exception will be that errors will not be caught in find_configs. Perhaps it is best to leave this configuration inside find_configs for now and change it sometime in the future if it turns problematic. |
| /// | ||
| /// Only supported with `CGL` (`macOS`) | ||
| #[inline] | ||
| pub fn skip_cgl_profile(mut self, skip: bool) -> Self { |
There was a problem hiding this comment.
Can we infer it from with_api/Api instead?
There was a problem hiding this comment.
By skipping profile selection when ConfigTemplate::api is None? We can do that if you're okay with profile selection being skipped by default.
There was a problem hiding this comment.
I think so, though, it's technically a behavior change, but probably it's fine? What it picks on recent enough macs?
There was a problem hiding this comment.
It will switch to the legacy OpenGL (OpenGL 2.1) + extensions. I'm fine with making it check the Actually it is fine; users will just have to assume they can't rely on OpenGL being selected without ConfigTemplate::api, however it doesn't feel very intuitive that you need to select OpenGL explicitly in the Apiwith_api on macOS, and it will look to them like something else may be selected.
CHANGELOG.mdif knowledge of this change could be valuable to usersCreated or updated an example program if it would help users understand this functionalityThis is essentially the same as #1740 , with the exception of allowing configurable behavior and in being more compact. By default, nothing is changed to the previous behavior of
glutinon macOS (CGL) except the added no-profile fallback when all prior profile selections fail.Essentially, it addresses the problem of certain OpenGL extensions not working on macOS (
ARB_framebuffer_object).All the formatting errors are pre-existing.