Fix model loading

- Fix texture path storing full path instead of texture name making the texture loaded check always fail
This commit is contained in:
Linloir 2022-12-13 12:26:58 +08:00
parent b6b0da76d4
commit c911ac1613
No known key found for this signature in database
GPG Key ID: 58EEB209A0F2C366

View File

@ -13,7 +13,7 @@ QOpenGLContext* sharedContext;
// Must set context before calling this function // Must set context before calling this function
Texture::Texture(TextureType type, std::string path) { Texture::Texture(TextureType type, std::string path) {
_type = type; _type = type;
_path = path; _path = path.substr(path.find_last_of('/') + 1);
OPENGL_FUNCTIONS->glGenTextures(1, &_id); OPENGL_FUNCTIONS->glGenTextures(1, &_id);
OPENGL_FUNCTIONS->glBindTexture(GL_TEXTURE_2D, _id); OPENGL_FUNCTIONS->glBindTexture(GL_TEXTURE_2D, _id);