LearnOpenTK icon indicating copy to clipboard operation
LearnOpenTK copied to clipboard

Parameter of the OnFramebufferResize method in Chapter 1/2 is wrong

Open cneicy opened this issue 7 months ago • 3 comments

OpenTK4 https://opentk.net/learn/chapter1/2-hello-triangle.html?tabs=onload-opentk4%2Conrender-opentk4%2Cresize-opentk4#some-new-functions What in sample is

protected override void OnFramebufferResize(ResizeEventArgs e)
{
    base.OnFramebufferResize(e);

    GL.Viewport(0, 0, e.Width, e.Height);
}

but the parameter in source is

protected virtual void OnFramebufferResize(FramebufferResizeEventArgs e)
{
  Action<FramebufferResizeEventArgs> framebufferResize = this.FramebufferResize;
  if (framebufferResize == null)
      return;
  framebufferResize(e);
}

cneicy avatar Jul 06 '24 03:07 cneicy