Skip to content

Simplify usage of Context #267

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Simplify usage of Context #267

wants to merge 2 commits into from

Conversation

madsmtm
Copy link
Member

@madsmtm madsmtm commented Jun 5, 2025

Simplify creation of Context in examples by constructing it before running the event loop with the new-ish EventLoop::owned_display_handle.

This PR also makes Context Clone when the inner display handle is, to allow more easily passing it around.

@madsmtm madsmtm added the enhancement New feature or request label Jun 5, 2025
@madsmtm madsmtm force-pushed the madsmtm/context-easier branch from e2d94d0 to b97e10e Compare June 5, 2025 13:58
let context = Context::new(elwt).unwrap();
Surface::new(&context, &window).unwrap()
};
let mut surface = { Surface::new(&context, &window).unwrap() };
Copy link
Member

Choose a reason for hiding this comment

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

The braces are redundant now. (Though I'm not sure there was much need for them before either.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

2 participants