opentk / LearnOpenTK

A port of learnopengl.com's tutorials to OpenTK and C#.
Creative Commons Attribution 4.0 International
466 stars 115 forks source link

OnResize logic isn't correct #96

Open NvC-DmN-CH opened 4 months ago

NvC-DmN-CH commented 4 months ago

https://github.com/opentk/LearnOpenTK/blob/6825eba6a99e097236eb17b768f59c157e6dadde/Chapter1/2-HelloTriangle/Window.cs#L185

I set the window to (1280, 720) but the GL.Viewport is actually set to: image

When I used ClientRectangle.Size.X and ClientRectangle.Size.Y it became proper: image

NogginBops commented 4 months ago

The correct property is actually FramebufferSize, others will break on macOS. Will fix next time I do some work on these tutorials (if no one else has made a PR)

NvC-DmN-CH commented 4 months ago

Oh ok, thank you!