engine/include/util/files.h

22 lines
645 B
C
Raw Normal View History

2023-05-01 12:55:49 +00:00
#ifndef ENGINE_INCLUDE_UTIL_FILES_H_
#define ENGINE_INCLUDE_UTIL_FILES_H_
2022-11-22 21:50:06 +00:00
#include <memory>
#include <string>
2023-05-01 12:55:49 +00:00
#include <vector>
namespace engine {
namespace util {
2022-11-22 21:50:06 +00:00
2023-05-01 12:55:49 +00:00
std::unique_ptr<std::vector<char>> ReadTextFile(const std::string& path);
std::unique_ptr<std::vector<uint8_t>> ReadBinaryFile(const std::string& path);
2022-11-22 21:50:06 +00:00
2023-05-01 12:55:49 +00:00
// Read an image file into a vector byte buffer. PNG and JPG support at a
// minimum. Output format is R8G8B8A8_UINT
std::unique_ptr<std::vector<uint8_t>> ReadImageFile(const std::string& path,
int* width, int* height);
2023-03-23 19:07:10 +00:00
2023-05-01 12:55:49 +00:00
} // namespace util
} // namespace engine
2022-11-22 21:50:06 +00:00
2023-05-01 12:55:49 +00:00
#endif