public void OnSurfaceChanged(IGL10 gl, int width, int height) { gl.GlViewport(0, 0, width, height); mViewportWidth = width; mViewportHeight = height; float ratio = (float)width / height; mViewRect.Top = 1.0f; mViewRect.Bottom = -1.0f; mViewRect.Left = -ratio; mViewRect.Right = ratio; UpdatePageRects(); gl.GlMatrixMode(GL10.GlProjection); gl.GlLoadIdentity(); if (USE_PERSPECTIVE_PROJECTION) { GLU.GluPerspective(gl, 20f, (float)width / height, .1f, 100f); } else { GLU.GluOrtho2D(gl, mViewRect.Left, mViewRect.Right, mViewRect.Bottom, mViewRect.Top); } gl.GlMatrixMode(GL10.GlModelview); gl.GlLoadIdentity(); }