Esempio n. 1
0
        private void readSceneToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                ISceneParser sceneParser = null;
                if (Path.GetExtension(openFileDialog1.FileName) == ".sl")
                {
                    sceneParser = new SphereScriptParser();
                }
                else
                {
                    sceneParser = new TextSceneParser();
                }

                r.Root          = sceneParser.ParseScene(openFileDialog1.FileName);
                this.debug.Text = openFileDialog1.FileName;
            }
            Invalidate();
        }
Esempio n. 2
0
        private void OpenScene_Click(object sender, RoutedEventArgs e)
        {
            var ofd = new System.Windows.Forms.OpenFileDialog()
            {
                Filter = "pliki *.sl|*.sl|wszystkie pliki|*.*"
            };

            if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                ISceneParser sceneParser = null;
                if (System.IO.Path.GetExtension(ofd.FileName) == ".sl")
                {
                    sceneParser = new SphereScriptParser();
                }
                else
                {
                    sceneParser = new TextSceneParser();
                }

                _rayCaster.Root = sceneParser.ParseScene(ofd.FileName);
            }

            Render();
        }