Ejemplo n.º 1
0
        public void aaEllipseRGBA()
        {
            this.InitSdl();

            //Random rand = new Random();
            int result = SdlGfx.aaellipseRGBA(surfacePtr, 200, 100, 100, 50, 200, 0, (byte)0, 254);

            result = Sdl.SDL_Flip(surfacePtr);
            Thread.Sleep(sleepTime);
            Assert.AreEqual(result, 0);
            this.Quit();
        }
Ejemplo n.º 2
0
 /// <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.filledEllipseRGBA(surface.Handle, this.PositionX, this.PositionY, this.RadiusX, this.RadiusY, color.R, color.G, color.B,
                                               color.A);
         GC.KeepAlive(this);
         if (result != (int)SdlFlag.Success)
         {
             throw SdlException.Generate();
         }
     }
     else
     {
         int result = 0;
         if (antiAlias)
         {
             result = SdlGfx.aaellipseRGBA(
                 surface.Handle, this.PositionX, this.PositionY,
                 this.RadiusX, this.RadiusY,
                 color.R, color.G, color.B,
                 color.A);
             GC.KeepAlive(this);
         }
         else
         {
             result = SdlGfx.ellipseRGBA(
                 surface.Handle, this.PositionX, this.PositionY,
                 this.RadiusX, this.RadiusY,
                 color.R, color.G, color.B,
                 color.A);
             GC.KeepAlive(this);
         }
         if (result != (int)SdlFlag.Success)
         {
             throw SdlException.Generate();
         }
     }
 }