Esempio n. 1
0
        protected override void Draw()
        {
            // Clear to the default control background color.
            Color backColor = new Color(BackColor.R, BackColor.G, BackColor.B);

            GraphicsDevice.Clear(backColor);

            double elapsed = Timer.Elapsed.TotalSeconds;

            Timer.Restart();
            DoUpdate(new GameTime(TimeSpan.FromSeconds(elapsed), TimeSpan.FromSeconds(elapsed)));
            DoDraw(g);

            BackgroundGrid.Draw(g, ActiveCamera.View);

            GraphicsDevice.Clear(ClearOptions.DepthBuffer, Color.White, 1, 0);
            g.GraphicsDevice.RasterizerState = RasterizerState.CullNone;
            if (SelectedObject != null)
            {
                if (SelectionType != SelectionTypes.None)
                {
                    if (SelectionMode == SelectionModes.Move)
                    {
                        MoveHelper.Draw(g, ActiveCamera.View);
                    }
                    else if (SelectionMode == SelectionModes.Rotate)
                    {
                        RotationHelper.Draw(g, ActiveCamera.View);
                    }
                }
            }

            Thread.Sleep(1);
        }
Esempio n. 2
0
        public override void Draw(CustomSpriteBatch g, Matrix View)
        {
            ObjectEffect.View = View;

            VisibleDirection.LinesEffect.World = ObjectEffect.World;

            ObjectEffect.CurrentTechnique.Passes[0].Apply();
            g.GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, ArrayVertexBound, 0, 8);

            VisibleDirection.Draw(g, View);
        }