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

[RFC] Merging HeadlessContext and Context #1028

Closed
keringar opened this issue Jun 10, 2018 · 5 comments
Closed

[RFC] Merging HeadlessContext and Context #1028

keringar opened this issue Jun 10, 2018 · 5 comments

Comments

@keringar
Copy link

I don't think there's currently any way to share a regular context with a headless context because of the split between HeadlessContext and Context. There's a couple differences between the two in their implementation, but API wise I don't think there's much use in separating them out (AFAIK). Any thoughts or are there better ways to create shared regular and headless contexts?

@goddessfreya
Copy link
Contributor

Would this change allow us to create a context without a window then share it with multiple windows? If so, Id be 100% aboard.

@keringar
Copy link
Author

keringar commented Jun 11, 2018 via email

@mitchmindtree
Copy link
Contributor

Maybe rather than merging the two, we could have the shared context argument be a &GlContext (which both Context and HeadlessContext implement), though I don't remember if it should be as simple as swapping out some types or if this would require a more involved change.

@keringar
Copy link
Author

I thought about that and we could use the GlContextExt trait to get the raw handle since the platform specific code needs access to the actual context handle. But even if we go that way than there's still a lot of code duplication between the Context and HeadlessContext that we could remove by merging the two. For example on windows, linux, and macos the headless context mostly just delegates to the inner Context .

@goddessfreya
Copy link
Contributor

Should be closed now.

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

No branches or pull requests

4 participants