FBX파일 읽기 로직 완성

This commit is contained in:
2025-05-18 19:23:30 +09:00
parent 45ee4f0056
commit 3a9dbcb470
5 changed files with 42 additions and 11 deletions

View File

@@ -31,9 +31,13 @@ void Graphics::CreateTextureSampler() {
}
TextureHandle Graphics::CreateTexture(gsl::czstring path) {
std::vector<std::uint8_t> data = ReadFile(path);
return CreateTexture({data.data(), data.size()});
}
TextureHandle Graphics::CreateTexture(gsl::span<std::uint8_t> image_file_data) {
glm::ivec2 image_extents;
std::int32_t channels;
std::vector<std::uint8_t> image_file_data = ReadFile(path);
stbi_uc* pixel_data = stbi_load_from_memory(
image_file_data.data(), image_file_data.size(), &image_extents.x,
&image_extents.y, &channels, STBI_rgb_alpha);