From c6e197527e2953d5f6cd42839139a124ae9258f9 Mon Sep 17 00:00:00 2001 From: Reuben Dunnington Date: Thu, 10 Aug 2023 11:34:44 -0700 Subject: [PATCH] add error logs to mg_image_create_* --- src/graphics/graphics_common.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/graphics/graphics_common.c b/src/graphics/graphics_common.c index b8b1c93..99f146a 100644 --- a/src/graphics/graphics_common.c +++ b/src/graphics/graphics_common.c @@ -1607,6 +1607,10 @@ mg_image mg_image_create_from_data(mg_surface surface, str8 data, bool flip) image = mg_image_create_from_rgba8(surface, width, height, pixels); free(pixels); } + else + { + log_error("stbi_load_from_memory() failed: %s\n", stbi_failure_reason()); + } return(image); } @@ -1626,6 +1630,10 @@ mg_image mg_image_create_from_file(mg_surface surface, str8 path, bool flip) image = mg_image_create_from_rgba8(surface, width, height, pixels); free(pixels); } + else + { + log_error("stbi_load() failed: %s\n", stbi_failure_reason()); + } return(image); }