From 15069341c7c8c36c7371ea1de4b63ed52034b3a8 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Mon, 12 Sep 2022 22:04:54 +0200 Subject: Fix texture uploading bug --- src/gltf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gltf.cpp') 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()).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(image.x), static_cast(image.y), VK_FORMAT_R8G8B8A8_UNORM, sampler); + auto *texture = vkrenderer::create_2d_texture(static_cast(image.width), static_cast(image.height), VK_FORMAT_R8G8B8A8_UNORM, sampler); texture->update(image.data); -- cgit v1.3