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