Open Frostchi opened 6 months ago
Not sure if related to https://github.com/opentk/GLWpfControl/issues/58
Currently creating GLWPFControls on separate threads is likely not going to work as GLWPFControl is using a static shared OpenGL context which can only be current on one thread. This is a problem when creating controls from another thread as this will call functions that need to access the opengl context, but this context is not going to be current on the separate thread.
There might be some ways around this, I've been slowly refactoring the GLWPFControl code to avoid some of these types of issues (more explicit handling of contexts), but I've not finished that work, not sure when I'll have time to.
Currently creating GLWPFControls on separate threads is likely not going to work as GLWPFControl is using a static shared OpenGL context which can only be current on one thread. This is a problem when creating controls from another thread as this will call functions that need to access the opengl context, but this context is not going to be current on the separate thread.
There might be some ways around this, I've been slowly refactoring the GLWPFControl code to avoid some of these types of issues (more explicit handling of contexts), but I've not finished that work, not sure when I'll have time to.
Thanks for the quick response! I am going to hold off on my Winforms -> WPF rewrite for the time being in that case... :grin:
Description
Using the new SKGLElement in SkiaSharp, I get an access violation at the following location in GLWPFControl when I try create an additional SKGLElement on a new Thread:
Code
Expected Behavior
Ability to create multiple controls (across multiple threads) in application like in SkiaSharp.Views.WindowsForms
Actual Behavior
Unable to do this
Version of SkiaSharp
3.x (Alpha)
Last Known Good Version of SkiaSharp
Other (Please indicate in the description)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Windows
Platform / Operating System Version
Windows 11 23H2 64 bit
Devices
No response
Relevant Screenshots
No response
Relevant Log Output
Code of Conduct