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

Make sure the OpenGL context is "current" before drawing on it #1141

Merged
merged 1 commit into from
Feb 11, 2020

Conversation

mattleibow
Copy link
Contributor

Description of Change

If there are multiple SKGLControls drawing at the same time, there is the chance that one view may draw on another view. Or cause issues. This is because OpenGL is basically a thread-static library, and can only have a single "current" context per thread. By calling MakeCurrent, we are letting OpenGL know that this view is drawing and all operations are here. The next view that wants to draw then also lets OpenGL know that it wants to do some work and the OpenGL can "shift" over to that one.

Bugs Fixed

API Changes

None.

Behavioral Changes

When multiple SKGLControls are created, there is some cross-talk. This PR makes sure that each view requests control over all operations.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard
  • Updated documentation

@mattleibow mattleibow merged commit 089c263 into master Feb 11, 2020
@mattleibow mattleibow deleted the dev/fix-920 branch February 11, 2020 23:42
@mattleibow mattleibow added this to the v1.68.2 milestone Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Weird crosstalk between multiple canvas when using GPU-accelerated WPF with WindowsFormsHost
1 participant