Merge pull request #151 from ReDucTor/patch-1

Fixing spacing in mesh.h
This commit is contained in:
Joey de Vries
2019-12-23 11:59:10 +01:00
committed by GitHub

View File

@@ -69,15 +69,15 @@ public:
string number; string number;
string name = textures[i].type; string name = textures[i].type;
if(name == "texture_diffuse") if(name == "texture_diffuse")
number = std::to_string(diffuseNr++); number = std::to_string(diffuseNr++);
else if(name == "texture_specular") else if(name == "texture_specular")
number = std::to_string(specularNr++); // transfer unsigned int to stream number = std::to_string(specularNr++); // transfer unsigned int to stream
else if(name == "texture_normal") else if(name == "texture_normal")
number = std::to_string(normalNr++); // transfer unsigned int to stream number = std::to_string(normalNr++); // transfer unsigned int to stream
else if(name == "texture_height") else if(name == "texture_height")
number = std::to_string(heightNr++); // transfer unsigned int to stream number = std::to_string(heightNr++); // transfer unsigned int to stream
// now set the sampler to the correct texture unit // now set the sampler to the correct texture unit
glUniform1i(glGetUniformLocation(shader.ID, (name + number).c_str()), i); glUniform1i(glGetUniformLocation(shader.ID, (name + number).c_str()), i);
// and finally bind the texture // and finally bind the texture
glBindTexture(GL_TEXTURE_2D, textures[i].id); glBindTexture(GL_TEXTURE_2D, textures[i].id);