日期:2014-05-18 浏览次数:20856 次
protected override void OnSizeChanged(EventArgs e) { base.OnSizeChanged(e);//报错:“CsGL.OSLib”的类型初始值设定项引发异常 Size s = this.Size; if (s.Height == 0) s.Height = 1; GL.glViewport(0, 0, s.Width, s.Height); GL.glMatrixMode(GL.GL_PROJECTION); GL.glLoadIdentity(); GL.gluPerspective(45.0f, (double)s.Width / (double)s.Height, 0.1f, 100.0f); GL.glMatrixMode(GL.GL_MODELVIEW); GL.glLoadIdentity(); }