Open DigitalBox98 opened 7 months ago
Solution is to not use Bounds.Size and instead use the PixelSize as per Avalonia's answer on their repo :
private PixelSize GetPixelSize() { var scaling = TopLevel.GetTopLevel(this).RenderScaling; return new PixelSize(Math.Max(1, (int)(Bounds.Width scaling)), Math.Max(1, (int)(Bounds.Height scaling))); }
The GL.Viewport() in the BaseTkOpenGlControl class should take into account the scale factor of the monitor in order to display correctly on MacOS.
In the below example, the viewport should be scaled by a factor of 2 to work fine :
With OpenTK+ImGUI the below code is used when a window is resized for instance (OpenTK propose a GameWindow.FramebufferSize in order to have the correct value versus the Client size :
I don't know what is the equivalent for OpenTK+Avalonia, that's why I'm opening this issue