Add unloadSDLTTF call to RSDL destructor

This commit is contained in:
Tulpen 2023-05-24 19:38:51 +01:00
parent c4f097d6b1
commit cb6e2efead
2 changed files with 3 additions and 1 deletions

View file

@ -65,6 +65,7 @@ class RSDL : Renderer {
SDL_DestroyWindow(window);
SDL_Quit();
unloadSDLTTF();
unloadSDL();
}

View file

@ -5,12 +5,13 @@ import hibis.resources.resource;
import sdl_ttf;
import std.string : toStringz;
import std.stdio;
import std.format : format;
class Font : Resource {
this(string path, uint size) {
const char* nPath = cast(const(char)*)toStringz(path);
loadedFont = TTF_OpenFont(nPath, size);
writeln("Loaded font");
writeln(format("Loaded font at '%s'", path));
}
~this() {