-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Labels
Milestone
Description
Having a strange behavior where the GLWpfControl.OnLoaded() method, which just invalidates the visual of the control once it's loaded to be properly drawn, isn't run automatically, unless I specifically assign a new delegate to GLWpfControl.Loaded.
public DrawingDemo()
{
Debug.WriteLine("Creating the DemoControl!");
InitializeComponent();
DemoControl.Loaded += ControlLoaded;
Loaded += OnLoad;
Unloaded += OnUnload;
}
private void ControlLoaded(object sender, RoutedEventArgs e)
{
Debug.WriteLine("DemoControl loaded by OpenGL!");
}
If I comment out DemoControl.Loaded += ControlLoaded:


- The OpenGL Content remains grey until I manually resize the window.
- Automatically renders the drawn content, since InvalidateVisual() is called very early.
I'm using the LearnOpenTK tutorial right now, and I do understand there are some differences between the base assumption implementation (having the GameWindow and such) versus how it works in GLWpfControl, so I'm sure I may be misunderstanding something.
Using OpenTK 4.8.2, GLWpfControl 4.2.3, .NET Core 8.0.4, Visual Studio 2022 17.9.6.
Thanks for your help, and thanks for this project!

