TTF_RenderUTF8_Shaded() private method

private TTF_RenderUTF8_Shaded ( IntPtr font, string text, Tao.Sdl.Sdl fg, Tao.Sdl.Sdl bg ) : IntPtr
font System.IntPtr
text string
fg Tao.Sdl.Sdl
bg Tao.Sdl.Sdl
return System.IntPtr
Exemplo n.º 1
0
        public void RenderUTF8_Shaded()
        {
            this.Quit();
            this.Init();
            IntPtr surfacePtr = VideoSetup();

            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       fontPtr = SdlTtf.TTF_OpenFont("../../FreeSans.ttf", 24);

            Sdl.SDL_Color colorfg        = new Sdl.SDL_Color(254, 0, 0);
            Sdl.SDL_Color colorbg        = new Sdl.SDL_Color(0, 254, 0);
            IntPtr        fontSurfacePtr = SdlTtf.TTF_RenderUTF8_Shaded(fontPtr, "hello", colorfg, colorbg);

            Assert.IsFalse(fontSurfacePtr == IntPtr.Zero);
            int result = Sdl.SDL_BlitSurface(fontSurfacePtr, ref rect1, surfacePtr, ref rect2);

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