Files
RedScarfEngine/utilities/file_utils.h
T
Piotr Krygier 99fb36d9fd Add basic loader for gltf
Added loading of avocado. Something is still wrong though,
becaus I cannot see the seed. But basic functionality is there.
2026-03-19 21:00:39 +01:00

30 lines
845 B
C

#ifndef FILE_UTILS_H
#define FILE_UTILS_H
#include <stddef.h>
#include "commons.h"
#include "cgltf.h"
#define MAX_PATH_LENGTH (4096U)
/**
* @brief Reads file and puts its content into char buffer. If NULL is provided as buffer, than just bytes_count
* is set
*
* @param file_path Path to file
* @param bytes_count Returned bytes count
* @param buffer Returned filled buffer
*/
rse_err_t file_read_bytes(const char* file_path, size_t* bytes_count, char* buffer);
rse_err_t file_write(const char* file_name, size_t bytes_count, char* buffer);
rse_err_t file_load_pixels(const char* file_name, unsigned char* buffer, size_t* buffer_size, int* width, int* height);
rse_err_t file_append_full_path(char* file_path, size_t max_buffer_size);
rse_err_t file_load_gltf(const char* file_name, cgltf_data** data);
#endif /* FILE_UTILS_H */