TTF_RenderGlyph_Blended() private method

private TTF_RenderGlyph_Blended ( IntPtr font, short ch, Tao.Sdl.Sdl fg ) : IntPtr
font System.IntPtr
ch short
fg Tao.Sdl.Sdl
return System.IntPtr
Ejemplo n.º 1
0
        public void RenderGlyph_Blended()
        {
            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", 12);

            Sdl.SDL_Color colorfg        = new Sdl.SDL_Color(254, 0, 0);
            IntPtr        fontSurfacePtr = SdlTtf.TTF_RenderGlyph_Blended(fontPtr, 1000, colorfg);

            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();
        }