Ejemplo n.º 1
0
        public void zoomSurfaceSize()
        {
            int dstwidth;
            int dstheight;

            SdlGfx.zoomSurfaceSize(100, 33, 2, 4, out dstwidth, out dstheight);
            Assert.AreEqual(200, dstwidth);
            Assert.AreEqual(132, dstheight);
        }
Ejemplo n.º 2
0
        public void bezierColor()
        {
            this.InitSdl();
            //Random rand = new Random();
            int result = SdlGfx.bezierColor(surfacePtr, vx, vy, vx.Length, 4, 7777777);

            result = Sdl.SDL_Flip(surfacePtr);
            Thread.Sleep(sleepTime);
            Assert.AreEqual(result, 0);
            this.Quit();
        }
Ejemplo n.º 3
0
        public void FilledPolygonRGBA()
        {
            this.InitSdl();
            //Random rand = new Random();
            int result =
                SdlGfx.filledPolygonRGBA(surfacePtr, vx, vy, vx.Length, 200, 0, (byte)0, 254);

            result = Sdl.SDL_Flip(surfacePtr);
            Thread.Sleep(sleepTime);
            Assert.AreEqual(result, 0);
            this.Quit();
        }
Ejemplo n.º 4
0
        public void FilledTrigonPieRGBA()
        {
            this.InitSdl();

            //Random rand = new Random();
            int result = SdlGfx.filledTrigonRGBA(surfacePtr, 100, 100, 250, 400, 100, 300, 200, 0, (byte)0, 254);

            result = Sdl.SDL_Flip(surfacePtr);
            Thread.Sleep(sleepTime);
            Assert.AreEqual(result, 0);
            this.Quit();
        }
Ejemplo n.º 5
0
        public void aaTrigonColor()
        {
            this.InitSdl();

            //Random rand = new Random();
            int result = SdlGfx.aatrigonColor(surfacePtr, 100, 100, 250, 400, 100, 300, 7777777);

            result = Sdl.SDL_Flip(surfacePtr);
            Thread.Sleep(sleepTime);
            Assert.AreEqual(result, 0);
            this.Quit();
        }
Ejemplo n.º 6
0
        public void FilledPieColor()
        {
            this.InitSdl();

            //Random rand = new Random();
            int result = SdlGfx.filledPieColor(surfacePtr, 200, 100, 100, 50, 100, 7777777);

            result = Sdl.SDL_Flip(surfacePtr);
            Thread.Sleep(sleepTime);
            Assert.AreEqual(result, 0);
            this.Quit();
        }
Ejemplo n.º 7
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.º 8
0
        public void rectangleRGBA()
        {
            this.InitSdl();

            Random rand   = new Random();
            int    result = SdlGfx.rectangleRGBA(surfacePtr, 100, 200, 300, 300, 200, 0, (byte)0, 254);

            result = Sdl.SDL_Flip(surfacePtr);
            Thread.Sleep(sleepTime);
            Assert.AreEqual(result, 0);
            this.Quit();
        }
Ejemplo n.º 9
0
 public void ImageFilterAdd()
 {
     SdlGfx.SDL_imageFilterAdd(src1, src2, dest, src1.Length);
     //Console.WriteLine("result: " + result.ToString());
     //Console.WriteLine(
     //	"dest: " + dest[0].ToString() +
     //	", " + dest[1].ToString() + ", " + dest[2].ToString() +
     //	", " + dest[3].ToString());
     Assert.AreEqual(src1[0] + src2[0], dest[0]);
     Assert.AreEqual(src1[1] + src2[1], dest[1]);
     Assert.AreEqual(src1[2] + src2[2], dest[2]);
     Assert.AreEqual(src1[3] + src2[3], dest[3]);
 }
Ejemplo n.º 10
0
        public void stringColor()
        {
            this.InitSdl();

            //Random rand = new Random();
            int result = SdlGfx.stringColor(
                surfacePtr, 100, 100, "SDL.NET", 7777777);

            result = Sdl.SDL_Flip(surfacePtr);
            Thread.Sleep(sleepTime);
            Assert.AreEqual(result, 0);
            this.Quit();
        }
Ejemplo n.º 11
0
        public void charColor()
        {
            this.InitSdl();

            //Random rand = new Random();
            int result = SdlGfx.characterColor(
                surfacePtr, 100, 100, 'X', 7777777);

            result = Sdl.SDL_Flip(surfacePtr);
            Thread.Sleep(sleepTime);
            Assert.AreEqual(result, 0);
            this.Quit();
        }
Ejemplo n.º 12
0
        public void zoomSurface()
        {
            this.InitSdl();
            Sdl.SDL_Rect rect1          = new Sdl.SDL_Rect(0, 0, 400, 400);
            Sdl.SDL_Rect rect2          = new Sdl.SDL_Rect(0, 0, 400, 400);
            IntPtr       bmpImagePtr    = Sdl.SDL_LoadBMP("test.bmp");
            IntPtr       zoomSurfacePtr = SdlGfx.zoomSurface(bmpImagePtr, 5, 2, SdlGfx.SMOOTHING_OFF);

            Sdl.SDL_BlitSurface(zoomSurfacePtr, ref rect1, surfacePtr, ref rect2);
            Assert.IsNotNull(zoomSurfacePtr);
            Assert.IsFalse(zoomSurfacePtr == IntPtr.Zero);
            Sdl.SDL_UpdateRect(surfacePtr, 0, 0, 400, 400);

            //int results = Sdl.SDL_Flip(surfacePtr);
            Thread.Sleep(sleepTime);
        }