public SpaceApplication()
 {
     ClientSize = new Size(screenwidth, screenheight); // Specify the client size
     Text = "Intersacting meshes"; // Specify the title
     Options = new Options();
     Instance = this;
 }
        /// <summary>
        /// The main function
        /// </summary>
        private static void Main()
        {
            var mainForm = new SpaceApplication(); // Create the form

            if (mainForm.InitializeDirect3D() == false) // Check if D3D could be initialized
            {
                MessageBox.Show("Could not initialize Direct3D.", "Error");
                return;
            }

            RegisterCollisionDetectors();
            mainForm.Show(); // When everything is initialized, show the form
            Options.Show();
            while (mainForm.Created) // This is our message loop
            {
                mainForm.Render(); // Keep rendering until the program terminates
                Application.DoEvents(); // Process the events, like keyboard and mouse input
            }
        }