示例#1
0
        public void CloseFont()
        {
            this.Quit();
            this.Init();
            IntPtr fontPtr = SdlTtf.TTF_OpenFontIndexRW(Sdl.SDL_RWFromFile("../../FreeSans.ttf", "rb"), 1, 12, 0);

            SdlTtf.TTF_CloseFont(fontPtr);
            this.Quit();
        }
示例#2
0
        /**
         * Frees all native resources used.
         */
        public void unload()
        {
            // Free the loaded font handles
            foreach (var kv in handles)
            {
                SdlTtf.TTF_CloseFont(kv.Value);
            }

            // Clear out the font handle array
            handles.Clear();
        }
示例#3
0
 /// <summary>
 /// Closes Surface handle
 /// </summary>
 protected override void CloseHandle()
 {
     try
     {
         if (this.Handle != IntPtr.Zero)
         {
             SdlTtf.TTF_CloseFont(this.Handle);
             this.Handle = IntPtr.Zero;
         }
     }
     catch (System.NullReferenceException e)
     {
         e.ToString();
     }
     catch (AccessViolationException e)
     {
         Console.WriteLine(e.StackTrace);
         e.ToString();
     }
     finally
     {
         this.Handle = IntPtr.Zero;
     }
 }