m_pProgram->Use();
SetUpMatrix();
// This is the diffuse texture
// m_pMat->GetTexDif() return different texture names with different objects
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, m_pMat->GetTexDif());
glUniform1i(LOCATION_TEX_DIFF, 0);
// This is the normal texture
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, m_pMat->GetTexNormal());
glUniform1i(LOCATION_TEX_NORM, 1);
glBindVertexArray(m_uVAO);
glDrawElements(GL_TRIANGLES, m_uFaceNum * 3, GL_UNSIGNED_INT, (void*)0);
// query current binding texture, result is different among different draw calls
// but the shader still get same one, so strange.
int currentTex;
glGetIntegerv(GL_TEXTURE_BINDING_2D, ¤tTex);
printf("current binding texture: %d\n", currentTex);