-
-
Notifications
You must be signed in to change notification settings - Fork 477
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
Changes for Rust 2018. Removed distinction between {Combined,Separated}Context
s. Style changes.
#1105
Conversation
{Combined, Separated}Context
s.{Combined, Separated}Context
s. Style changes.
Waiting: rust-mobile/android-rs-glue#202 |
{Combined, Separated}Context
s. Style changes.{Combined,Separated}Context
s. Style changes.
Also, while I'm waiting, is there anything objectionable with the current separated context api, @Osspial? |
There are some bikesheddy/documentation things, but for the most part the API looks good. The biggest question I have is, if you use Also, creating a context for a window, deleting said context, then adding a new context with a different underlying pixel format may cause some problems on Windows. I'm not familiar enough with the backend to know if it runs into that problem, but it doesn't seem outside the realm of possibility. The other stuff I have is relatively nitpicky, though. I'll go ahead and add that in with a review. |
context: Context { context }, | ||
}, | ||
) | ||
} | ||
|
||
/// Borrow the inner `Window`. | ||
pub fn window(&self) -> &Window { | ||
pub fn window(&self) -> &WindowRef { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WindowRef
type currently isn't publicly exposed on the crate level, so it's impossible for a user to view documentation for it or match against it.
src/combined.rs
Outdated
} | ||
|
||
/// Builds the GL context using the passed `Window`, returning the context | ||
/// as a `SeparatedContext`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SeparatedContext
is no longer the correct type.
src/combined.rs
Outdated
Arced(Arc<Window>), | ||
} | ||
|
||
impl GlContext { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like how GlContext
and Context
are named. Having that distinction implies that Context
is a general, non-OpenGL-specific context and that GlContext
is the version of that for OpenGL, but that isn't what the types actually are. Instead, GlContext
is an OpenGL Context that's associated with a window and Context
is an OpenGL context that might be associated with a window. The naming should reflect that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very good point, altho I can't think of any good names. I've changed it toWindowedContext
?
/// incompatible system, out of memory, etc.). This should be very rare. | ||
/// - If the OpenGL context could not be created. This generally happens | ||
/// because the underlying platform doesn't support a requested feature. | ||
pub fn new_separated( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See issues I mentioned in the main comment. I'm not entirely sure what this function exists for, and its utility compared to just GlContext::new
isn't properly explained in the documentation.
That's actually a complete oversight, the scenario where there has already been a context made on the window, oops. The idea was that they'd pass in a window that's already made, but that's lacking a context, and we'd make it on it. The assumption was that someday in the near future winit will support making winit's I'll have to investigate further into this before the 0.20 release. |
So here is what I've gathered: With that said, w/ X11/Wayland + egl + mesa + radeonsi, mesa issues these harmless warnings when anybody calls
This is a mesa bug, and I'm looking into sending a possible solution upstream to the llvm devs. |
e1d73cc
to
00a3b53
Compare
Separated}Context`s. Style changes. Doc update. Signed-off-by: Hal Gentz <[email protected]>
context recreation support, an extra example, improved osmesa ext. Signed-off-by: Hal Gentz <[email protected]>
Hmm. I feel iffy about exposing We could also add platform-specific context creation functions for external windows via the |
Platform-specific context creation functions sounds like a good idea, I'll probably switch to that. |
Fixes #1102
Reverts: #1107, closing #1109
Hopefully rust-mobile/android-rs-glue#203 gets merged.
Signed-off-by: Hal Gentz [email protected]