-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Update pure_glow example to glutin 0.30 #2393
Comments
you are doing everything correctly afaict. glutin upgrade PR avoided touching too much code because if there's any unforeseen issues, it would be easier to rollback. I am still unfamiliar with the latest glutin, but i will try answering some questions. could be wrong though as i have not tested them. asking on winit matrix server might be more helpful.
I think you just require the latest version that you want. and if context creation fails, you just retry in a loop reducing the version until you create a context successfully // version = [ (4, 6), (4, 3), (3, 3)] and so on
let mut gl_context = None;
for (major, minor) in versions {
let attrs = ContextAttributesBuilder::new().with_context_api(ContextApi::OpenGl(Some(Version { major, minor}))).build(None);
if let Ok(ctx) gl_display.create_context(&gl_config, &context_attributes) {
gl_context = Some(ctx);
break;
}
}
let gl_context = gl_context.expect("could not find suitable context);
yep. it is easier that way.
with EGL atleast, you would use https://docs.rs/glutin/latest/glutin/surface/struct.SurfaceAttributesBuilder.html#method.with_srgb
I don't think you care about the number of samples? the closure is for people who want maximum multi-sampling support, but you don't need that.
I have no idea. that said, once the next release of egui is out, and if the number of bug reports are not too many, we can polish the eframe glutin backend for android and also do a pure glow example rewrite. |
@coderedart Thanks. And should I use |
always use Core, unless you are targeting really ancient hardware. |
A lot has changed in glutin 0.30, it would be nice if the pure_glow example could be updated to glutin 0.30 :)
I had some code that was based on the pure_glow example before, now I'm updating it to glutin 0.30, but I'm not sure if I'm doing everything correctly with the new ways of doing things.
You can find my code here: rust-windowing/glutin#1445 (comment)
I would appreciate if you can let me know if it's correct. The pure_glow example could be updated similarly.
The text was updated successfully, but these errors were encountered: