26 lines
No EOL
532 B
C#
26 lines
No EOL
532 B
C#
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;
|
|
}
|
|
}
|
|
} |