You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
If I keep it in:
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!
The text was updated successfully, but these errors were encountered:
chadvandy
changed the title
GLWpfControl.OnLoaded() event doesn't seem to be called, unless an additional delegate is added
GLWpfControl.Loaded event doesn't seem to be called, unless an additional delegate is added
May 29, 2024
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.
If I comment out
DemoControl.Loaded += ControlLoaded
:If I keep it in:
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!
The text was updated successfully, but these errors were encountered: