Ejemplo n.º 1
0
        /// <summary>
        /// Release resources here.
        /// </summary>
        /// <param name="e">Not used.</param>
        protected override void OnUnload(EventArgs e)
        {
            Exiting = true;             // Set a flag that the rendering thread should stop running.
            _RenderingThread.Join();
            _UpdatingThread.Join();

            MakeCurrent();

            // Delete textures from graphics memory space
            Texture.Teardown();
            Sound.Teardown();

            // Clean up what we allocated before exiting
            if (CanvasTexture != 0)
            {
                GL.DeleteTextures(1, ref CanvasTexture);
            }

            if (CanvasFBO != 0)
            {
                GL.Ext.DeleteFramebuffers(1, ref CanvasFBO);
            }
            base.OnUnload(e);
        }