コード例 #1
0
ファイル: SdlTestImage.cs プロジェクト: erin100280/Zelda.NET
        public void LoadBMP()
        {
            string file       = "test.bmp";
            IntPtr surfacePtr = VideoSetup();
            IntPtr imagePtr   = SdlImage.IMG_LoadBMP_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();
        }