diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2022-09-12 22:04:54 +0200 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2022-09-12 22:04:54 +0200 |
| commit | 15069341c7c8c36c7371ea1de4b63ed52034b3a8 (patch) | |
| tree | 41d3640acdf4de9baf8f3bfd86afb91be2a9ab1f /src/gltf.cpp | |
| parent | 1bb6caa5c8cb97f23f84ac9f3d4aa6c38b6d901c (diff) | |
Fix texture uploading bug
Diffstat (limited to 'src/gltf.cpp')
| -rw-r--r-- | src/gltf.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gltf.cpp b/src/gltf.cpp index 537e4e1..9b55cbb 100644 --- a/src/gltf.cpp +++ b/src/gltf.cpp @@ -118,7 +118,7 @@ void gltf::load_textures(const std::filesystem::path &path) { const auto &gltf_image = gltf_images[image_index]; auto filepath = (path / gltf_image["uri"].get<std::string>()).string(); auto& image = images[image_index]; - image.data = stbi_load(filepath.c_str(), &image.x, &image.y, &image.channels, 4); + image.data = stbi_load(filepath.c_str(), &image.width, &image.height, &image.channels, 4); } // const auto &gltf_samplers = gltf_json["samplers"]; @@ -143,7 +143,7 @@ void gltf::load_textures(const std::filesystem::path &path) { // sampler = samplers[sampler_index]; // } - auto *texture = vkrenderer::create_2d_texture(static_cast<uint32_t>(image.x), static_cast<uint32_t>(image.y), VK_FORMAT_R8G8B8A8_UNORM, sampler); + auto *texture = vkrenderer::create_2d_texture(static_cast<uint32_t>(image.width), static_cast<uint32_t>(image.height), VK_FORMAT_R8G8B8A8_UNORM, sampler); texture->update(image.data); |
