first commit

This commit is contained in:
2025-06-15 22:03:02 -04:00
commit 91d01a1441
25 changed files with 24689 additions and 0 deletions

28
src/file.cpp Normal file
View File

@ -0,0 +1,28 @@
#include "file.h"
bool
file_read(const char* path, void* buffer, size_t size)
{
SDL_IOStream* ioStream;
memset(buffer, '\0', size);
ioStream = SDL_IOFromFile(path, "r");
if (!ioStream)
{
printf(STRING_ERROR_FILE_READ, path);
return false;
}
if (!SDL_ReadIO(ioStream, buffer, size))
{
printf(STRING_ERROR_FILE_READ, path);
return false;
}
SDL_CloseIO(ioStream);
return true;
}