From c911ac1613e142a520a1fac0b0d5d85e149ec752 Mon Sep 17 00:00:00 2001 From: Linloir <3145078758@qq.com> Date: Tue, 13 Dec 2022 12:26:58 +0800 Subject: [PATCH] Fix model loading - Fix texture path storing full path instead of texture name making the texture loaded check always fail --- FinalProject/texture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FinalProject/texture.cpp b/FinalProject/texture.cpp index d8086a4..8bb6fc6 100644 --- a/FinalProject/texture.cpp +++ b/FinalProject/texture.cpp @@ -13,7 +13,7 @@ QOpenGLContext* sharedContext; // Must set context before calling this function Texture::Texture(TextureType type, std::string path) { _type = type; - _path = path; + _path = path.substr(path.find_last_of('/') + 1); OPENGL_FUNCTIONS->glGenTextures(1, &_id); OPENGL_FUNCTIONS->glBindTexture(GL_TEXTURE_2D, _id);