/// <summary> /// Initializes a new instance of the <see cref="GorgonDrawing"/> class. /// </summary> /// <param name="gorgon2D">The gorgon 2D interface that owns this object.</param> internal GorgonDrawing(Gorgon2D gorgon2D) { _depthStencil = new GorgonRenderable.DepthStencilStates(); _sampler = new GorgonRenderable.TextureSamplerState(); _blend = new GorgonRenderable.BlendState(); // Default to modulated blending for drawing operations. BlendingMode = BlendingMode.Modulate; CullingMode = CullingMode.Back; _rect = new GorgonRectangle(gorgon2D, "Gorgon2D.Rectangle", false) { Position = Vector2.Zero, Size = Vector2.Zero }; _point = new GorgonPoint(gorgon2D, "Gorgon2D.Point") { Position = Vector2.Zero, Color = GorgonColor.White }; _line = new GorgonLine(gorgon2D, "Gorgon2D.Line") { Color = GorgonColor.White, StartPoint = Vector2.Zero, EndPoint = Vector2.Zero }; _ellipse = new GorgonEllipse(gorgon2D, "Gorgon2D.Ellipse") { Quality = 64, Color = GorgonColor.White }; _triangle = new GorgonTriangle(gorgon2D, "Gorgon2D.Triangle") { IsFilled = false }; _string = gorgon2D.Renderables.CreateText("Gorgon2D.String"); }
public void TestEllipse() { _form.Show(); _form.ClientSize = new Size(1280, 800); _form.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width / 2 - 640, Screen.PrimaryScreen.WorkingArea.Height / 2 - 400); _form.BringToFront(); _form.WindowState = FormWindowState.Minimized; _form.WindowState = FormWindowState.Normal; GorgonEllipse ellipse = _renderer.Renderables.CreateEllipse("Test", new Vector2(320, 400), new Vector2(100, 100), Color.Blue, true, 32); Gorgon.Run(_form, () => { _renderer.Clear(Color.Black); ellipse.Color = Color.Blue; ellipse.IsFilled = true; ellipse.Position = new Vector2(480, 400); ellipse.Draw(); ellipse.Color = Color.Green; ellipse.IsFilled = false; ellipse.Position = new Vector2(800, 400); ellipse.Draw(); _renderer.Render(); return(true); }); Assert.IsTrue(_form.TestResult == DialogResult.Yes); }