protected override void Load()
        {
            SetVSync(true);

            Renderer.AddRenderer(new EntityRenderer(Renderer));
            Renderer.AddRenderer(new DebugRenderer(Renderer));
            Renderer.AddRenderer(new ChunkRenderer(Renderer));

            Renderer.Sun = new Light(Vector3.Zero, LightType.Directional, 1, Color.White);
            Renderer.Lights.Add(Renderer.Sun);

            Camera.Active.SetMode(CameraMode.ArcBall);
            Camera.Active.SmoothCamera = true;

            screen = new EditorScreen(this, Renderer);
        }
        public EditorUI(MasterRenderer renderer, EditorScreen screen)
        {
            this.renderer = renderer;
            this.screen   = screen;

            GUISystem gsys = renderer.Sprites.GUISystem;

            area = new GUIArea(gsys);
            renderer.Sprites.Add(area);

            theme = EditorTheme.Glass;


            GenBar(renderer.ScreenWidth);

            openFileWindow = new FileBrowserWindow(gsys, theme, new UDim2(0.75f, 0, 0.75f, 0), "Open Model",
                                                   FileBrowserMode.OpenFile, new string[] { ".aosm" },
                                                   (window) =>
            {
                if (File.Exists(window.FileName))
                {
                    screen.LoadModel(window.FileName);
                }
            });

            saveFileWindow = new FileBrowserWindow(gsys, theme, new UDim2(0.75f, 0, 0.75f, 0), "Save Model",
                                                   FileBrowserMode.Save, new string[] { ".aosm" },
                                                   (window) =>
            {
                string fullPath = Path.Combine(window.CurrentDirectory, window.FileName);

                if (!Path.HasExtension(fullPath))
                {
                    fullPath += ".aosm";
                }

                screen.SaveModel(fullPath);
            });

            gsys.Add(openFileWindow, saveFileWindow);
        }