-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
[WIP-RFC] Pure GL Contexts #942
Conversation
Originally the split between |
Thanks for taking a look!
That's a bit confusing to me because apparently
What would be the downside of the split? Roughly half of the methods in |
Well, the downside is code de-duplication. I'm not against a structural change in the traits, but I'm not a fan of having to add even more unsafe no-really-tested code in the backends. |
Did you mean |
With |
I'll have to get back to this and re-evaluate the state of the PR. |
Surfaceless contexts for EGL have been implemented on linux in 0.21. I get around to a glx implementation sometime. |
GL windowing system is a mess. Coming from Vulkan's model, it would be great to separate the concepts of GL contexts (as something that you can bind and issue GL commands with) and GL windows (as the main framebuffer destination, if any). Basically, this change comes from trying to implement the idea expressed in gfx-rs/gfx#1539 (comment)
What this PR has:
GlContext
trait is split intoGlContext
andGlWindowContext
Context
andHeadlessContext
, there is a newPureContext
type for such contents that have no surface attached to them (thus, no main framebuffer).PureContext
is implemented for GLX, requiringGLX_ARB_create_context
If this idea sounds good to you, I can start looking into other platforms/APIs. In the worst case, I assume one can always work around the lack of pure context support by creating a hidden surface. Also, the source of offscreen-rendering-context might be helpful.