rakkarage's picture


        /// <summary>
        /// Called when your window is resized. Set your viewport here. It is also
        /// a good place to set up your projection matrix (which probably changes
        /// along when the aspect ratio of your window).
        /// </summary>
        /// <param name="e">Contains information on the new Width and Size of the GameWindow.</param>
        protected override void OnResize(EventArgs e)
            Matrix4 projection = Matrix4.CreatePerspectiveFieldOfView((float)Math.PI / 4, Width / (float)Height, 1.0f, 64.0f);
            GL.LoadMatrix(ref projection);

from the sample, the comment says that event args contains resize info, i guess it doesn't? or doesn't need to? anymore?


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

This was changed to match the WinForms API a while ago (which doesn't contain size info), but the examples where not updated accordingly.

Should fix.

the Fiddler's picture

Fixed in SVN rev. 2328.