I have the problem, that whenever I maximize the window, the size of the objects doesn't change like it should. If I just resize the window, the objects scale as they should, only maximizing doesn't work.
But the changes happen after the window leaves maximized mode. So after going back to normal window size, I can only see a small part of the rendered object.
The example is really simple; it just draws some triangle.
I don't think there's anything interesting happening; but they included this override:
protected override void OnResize(ResizeEventArgs e)
{
GL.Viewport(0, 0, Size.X, Size.Y);
base.OnResize(e);
}
So I guess this resizes the objects when resizing the window. I tried something similar for the maximizing event, but it didn't work:
protected override void OnMaximized(MaximizedEventArgs e)
{
GL.Viewport(0, 0, Size.X, Size.Y);
base.OnMaximized(e);
}
I even put GL.Viewport(0, 0, Size.X, Size.Y);
at the beginning of the OnRenderFrame(...)
-Function, but that didn't help either. (Size.X and Size.Y are correct all the time, i checked them.)
question from:
https://stackoverflow.com/questions/65909404/maximizing-opentk-window-doesnt-resize-the-shown-objects 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…