Пример #1
0
        public void LoadTGA()
        {
            string file       = "test.tga";
            IntPtr surfacePtr = VideoSetup();
            IntPtr imagePtr   = SdlImage.IMG_LoadTGA_RW(Sdl.SDL_RWFromFile(file, "rb"));

            Assert.IsFalse(imagePtr == IntPtr.Zero);
            Sdl.SDL_Rect rect1  = new Sdl.SDL_Rect(0, 0, 200, 200);
            Sdl.SDL_Rect rect2  = new Sdl.SDL_Rect(0, 0, 200, 200);
            int          result = Sdl.SDL_BlitSurface(imagePtr, ref rect1, surfacePtr, ref rect2);

            Sdl.SDL_UpdateRect(surfacePtr, 0, 0, 200, 200);
            Thread.Sleep(sleepTime);
            Assert.AreEqual(result, 0);
            this.Quit();
        }