KumiScript/renderer/sdl/SDLFont.cs

26 lines
532 B
C#
Raw Permalink Normal View History

using SDL2;
namespace KumiScript.Renderer
{
public class SDLFont : IDisposable
{
nint _handle;
public SDLFont(string path, int points)
{
_handle = SDL_ttf.TTF_OpenFont(path, points);
if (_handle == 0)
throw new Exception(SDL_ttf.TTF_GetError());
}
public void Dispose()
{
SDL_ttf.TTF_CloseFont(_handle);
return;
}
public nint GetHandle()
{
return _handle;
}
}
}