Exemplo n.º 1
0
        static void Main()
        {
            // show control panel
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            SettingsForm controlPanel = new SettingsForm();
            controlPanel.Show();

            // start terrain viewer
            TerrainForm form = new TerrainForm();
            form.Initialize(controlPanel);
            form.Show();
            try
            {
                Application.Run(form);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Application exception. \n\n" + ex);
                return;
            }
        }
Exemplo n.º 2
0
        public void Initialize(SettingsForm form)
        {
            // initialize devices
            InitDevice();
            InitKeyboard();

            // initialize graphics
            InitCamera();
            InitLights();
            InitMaterial();

            // read settings
            controlPanel = form;
            form.Refresh();
            LoadSettings();

            // generate initial height map
            Generate();
        }