Print out CWD on non-windows environments for debug purposes

This commit is contained in:
Shylie 2024-05-29 07:57:15 -04:00
parent ffcafb5160
commit 1e0be8eca0
2 changed files with 13 additions and 0 deletions

View File

@ -831,6 +831,10 @@ int glerminal_load_sprites_file(const char* filename)
success = true;
}
else if (buffer)
{
std::cout << "Invalid image width/height" << std::endl;
}
stbi_image_free(buffer);

View File

@ -4,12 +4,21 @@
#include <iostream>
#ifndef _WIN32
#include <unistd.h>
#endif
namespace
{
void init()
{
if (!glerminal_load_sprites_file("resources/image.png"))
{
#ifndef _WIN32
char buffer[257] = {};
getcwd(buffer, 256);
std::cout << buffer << std::endl;
#endif
std::cout << "Failed to load texture" << std::endl;
}