From aeaac1833f9ed9612b9e7a549e1563be4a08b84a Mon Sep 17 00:00:00 2001 From: Linloir <3145078758@qq.com> Date: Sun, 18 Dec 2022 10:02:39 +0800 Subject: [PATCH] [CORE][CHG] Add logger in texture loader --- FinalProject/texture.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/FinalProject/texture.cpp b/FinalProject/texture.cpp index 7fbc98e..4c80eef 100644 --- a/FinalProject/texture.cpp +++ b/FinalProject/texture.cpp @@ -34,19 +34,22 @@ Texture::Texture(TextureType type, std::string path) { if (data) { GLenum format; if (nrChannels == 1) { + Logger::debug("Texture " + _path + " is a grayscale image"); format = GL_RED; } else if (nrChannels == 3) { + Logger::debug("Texture " + _path + " is a RGB image"); format = GL_RGB; } else if (nrChannels == 4) { + Logger::debug("Texture " + _path + " is a RGBA image"); format = GL_RGBA; } else { Logger::error("Unexpected channel count"); return; } - + OPENGL_FUNCTIONS->glTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format, GL_UNSIGNED_BYTE, data); OPENGL_FUNCTIONS->glGenerateMipmap(GL_TEXTURE_2D); }