Пример #1
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            InitializeUI();

            StaticTaskQueue.TaskQueue.CreateRepeatingTask("AccelRotate", ModelRotate, 15);
            StaticTaskQueue.TaskQueue.CreateRepeatingTask("Animate", ModelAnimate, 1000 / 30);

            _consoleCommands.Register(StaticConsole.Console);

            _camera = new FuncCamera(GraphicsContext, () => _editor.CameraPosition.AsVector())
            {
                ZoomDistance = 4
            };

            _effect          = GraphicsContext.CreateEffect("defaultAmbient.fx");
            _techniqueHandle = _effect.CreateHandle("TVertexAndPixelShader");

            _consoleRenderer = new ConsoleRenderer(GraphicsContext, StaticConsole.Console)
            {
                Visible = false
            };
            _modelRenderer = new EpicModelRenderer(GraphicsContext);
            _modelRenderer.SetMaterials(_editor.Materials);

            _coordinateMarkerRenderer = new CoordinateMarkerRenderer(GraphicsContext);

            GraphicsContext.ClearColour    = Color.CornflowerBlue.ToColor4();
            GraphicsContext.ZBufferEnabled = true;
        }