/// <summary> /// Draw filled primitive onto surface /// </summary> /// <param name="surface">Surface to draw to</param> /// <param name="color">Color to fill primitive</param> /// <param name="antiAlias">antialias primitive</param> /// <param name="fill">fill primitive with color</param> public void Draw(Surface surface, System.Drawing.Color color, bool antiAlias, bool fill) { if (surface == null) { throw new ArgumentNullException("surface"); } if (fill) { int result = SdlGfx.texturedPolygon(surface.Handle, this.PositionsX(), this.PositionsY(), this.NumberOfSides, this.texturedSurface.Handle, this.textureOffsetX, this.textureOffsetY); GC.KeepAlive(this); if (result != (int)SdlFlag.Success) { throw SdlException.Generate(); } } else { int result = 0; if (antiAlias) { result = SdlGfx.aapolygonRGBA(surface.Handle, this.PositionsX(), this.PositionsY(), this.NumberOfSides, color.R, color.G, color.B, color.A); GC.KeepAlive(this); } else { result = SdlGfx.polygonRGBA(surface.Handle, this.PositionsX(), this.PositionsY(), this.NumberOfSides, color.R, color.G, color.B, color.A); GC.KeepAlive(this); } if (result != (int)SdlFlag.Success) { throw SdlException.Generate(); } } }