/// <summary> /// Draws a solid filled rectangle. /// </summary> /// <param name="rect"></param> public override void DrawFilledRect(Rectangle input) { Rectangle rect = Translate(input); if (m_ClipEnabled) { if (rect.Y < ClipRegion.Y) { int oldHeight = rect.Height; int delta = ClipRegion.Y - rect.Y; rect.Height -= delta; if (rect.Height <= 0) return; } if ((rect.Y + rect.Height) > (ClipRegion.Y + ClipRegion.Height)) { int oldHeight = rect.Height; int delta = (rect.Y + rect.Height) - (ClipRegion.Y + ClipRegion.Height); rect.Height -= delta; if (rect.Height <= 0) return; } if (rect.X < ClipRegion.X) { int oldWidth = rect.Width; int delta = ClipRegion.X - rect.X; rect.Width -= delta; if (rect.Width <= 0) return; } if ((rect.X + rect.Width) > (ClipRegion.X + ClipRegion.Width)) { int oldWidth = rect.Width; int delta = (rect.X + rect.Width) - (ClipRegion.X + ClipRegion.Width); rect.Width -= delta; if (rect.Width <= 0) return; } } Vector2 pos = new Vector2((float)rect.X, (float)rect.Y); Vector2 size = new Vector2((float)rect.Width, (float)rect.Height); FreezingArcher.Math.Color4 col = new FreezingArcher.Math.Color4(DrawColor.R, DrawColor.G, DrawColor.B, DrawColor.A); PrivateRendererContext.DrawFilledRectangleAbsolute(ref pos, ref size, ref col); }
/// <summary> /// Draws a line. /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="a"></param> /// <param name="b"></param> public override void DrawLine(int x, int y, int a, int b) { Translate(ref x, ref y); Translate(ref a, ref b); Vector2 posa = new Vector2((float)x, (float)y); Vector2 posb = new Vector2((float)a, (float)b); FreezingArcher.Math.Color4 col = new FreezingArcher.Math.Color4(DrawColor.R, DrawColor.G, DrawColor.B, DrawColor.A); PrivateRendererContext.DrawLineAbsolute(ref posa, ref posb, 1.0f, ref col); }