Esempio n. 1
0
        public NativeDesignControl(DesignView designView) :
            base(designView)
        {
            if (s_marqueePen == null)
            {
                s_marqueePen             = new Pen(Color.FromArgb(30, 30, 30), 2);
                s_marqueePen.DashPattern = new float[] { 3, 3 };
            }

            m_renderState                = new RenderState();
            m_renderState.RenderFlag     = GlobalRenderFlags.Solid | GlobalRenderFlags.Textured | GlobalRenderFlags.Lit | GlobalRenderFlags.Shadows;
            m_renderState.WireFrameColor = Color.DarkBlue;
            m_renderState.SelectionColor = Color.FromArgb(66, 255, 161);
            BackColor = SystemColors.ControlDark;
            m_renderState.OnChanged += (sender, e) => Invalidate();

            Adapter = new DesignControlAdapter(
                this, Camera,
                GameEngine.GetEditorSceneManager(),
                GameEngine.GlobalSelection, GameEngine.GetSavedResources());

            Adapter.AddRenderCallback((GUILayer.SimpleRenderingContext context) => RenderManipulators(context, designView));
            Adapter.AddRenderCallback((GUILayer.SimpleRenderingContext context) => RenderExtras(context, designView));
        }