Add MaterialType in COpenGLSLMaterialRenderer::OnSetMaterial back in

Shouldn't have been removed with last commit.
But adding some comments as it's slightly confusing.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6470 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien 2023-04-24 16:01:13 +00:00
parent c4bbbe1aaf
commit 37d821dcc3

@ -237,10 +237,13 @@ void COpenGLSLMaterialRenderer::OnSetMaterial(const video::SMaterial& material,
COpenGLCacheHandler* cacheHandler = Driver->getCacheHandler();
if (Program2)
Driver->irrGlUseProgram(Program2);
else if (Program)
Driver->extGlUseProgramObject(Program);
if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) // each program has it's own type
{
if (Program2)
Driver->irrGlUseProgram(Program2);
else if (Program)
Driver->extGlUseProgramObject(Program);
}
Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates);