diff libmlk-core/mlk/core/font.c @ 547:c7664b679a95

misc: remove error codes for now
author David Demelier <markand@malikania.fr>
date Mon, 06 Mar 2023 20:03:00 +0100
parents 338a4436e255
children 6271599928d4
line wrap: on
line diff
--- a/libmlk-core/mlk/core/font.c	Mon Mar 06 20:01:00 2023 +0100
+++ b/libmlk-core/mlk/core/font.c	Mon Mar 06 20:03:00 2023 +0100
@@ -34,7 +34,7 @@
 	assert(path);
 
 	if (!(font->handle = TTF_OpenFont(path, size)))
-		return MLK_ERR_SDL;
+		return mlk_errf("%s", SDL_GetError());
 
 	return 0;
 }
@@ -52,7 +52,7 @@
 
 	if (!(ops = SDL_RWFromConstMem(buffer, buflen)) ||
 	   (!(font->handle = TTF_OpenFontRW(ops, 1, size))))
-		return MLK_ERR_SDL;
+		return mlk_errf("%s", SDL_GetError());
 
 	return 0;
 }
@@ -88,7 +88,7 @@
 	}
 
 	if (!(surface = func(font->handle, text, fg)))
-		return MLK_ERR_SDL;
+		return mlk_errf("%s", SDL_GetError());
 
 	return mlk__texture_from_surface(tex, surface);
 }
@@ -113,7 +113,7 @@
 		*h = 0;
 
 	if (TTF_SizeUTF8(font->handle, text, (int *)w, (int *)h) != 0)
-		return MLK_ERR_SDL;
+		return mlk_errf("%s", SDL_GetError());
 
 	return 0;
 }