Exemplo n.º 1
0
        private void SetupViewport()
        {
            // If this throws an assert, you are calling MakeCurrent() before the glControl is done being constructed.
            // Call this function you have called Show().
            glControl.MakeCurrent();
            int w = glControl.Width;
            int h = glControl.Height;

#if USE_GLES
            GL.MatrixMode(All.Projection);
#else
            GL.MatrixMode(MatrixMode.Projection);
#endif
            GL.LoadIdentity();
            GL.Ortho(0, w, 0, h, -1, 1);         // Bottom-left corner pixel has coordinate (0, 0)
            GL.Viewport(0, 0, w, h);             // Use all of the glControl painting area
        }
Exemplo n.º 2
0
        protected override void OnClosed(EventArgs e)
        {
            glControl.MakeCurrent();

            glControl.releaseAllGlData.Release();

            base.OnClosed(e);
        }