engine/include/util/files.h

18 lines
522 B
C
Raw Permalink Normal View History

2024-03-31 10:11:22 +00:00
#pragma once
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
2024-03-31 10:11:22 +00:00
std::unique_ptr<std::vector<uint8_t>> ReadImageFile(const std::string& path, int& width, int& height);
2023-03-23 19:07:10 +00:00
2024-03-31 10:11:22 +00:00
} // namespace util
} // namespace engine