Merging r6468 through r6476 from trunk to ogl-es branch
Note: Not yet using latest changes to IMaterialRendererServices in ES2 driver git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6477 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@@ -237,7 +237,7 @@ void COpenGLSLMaterialRenderer::OnSetMaterial(const video::SMaterial& material,
|
||||
|
||||
COpenGLCacheHandler* cacheHandler = Driver->getCacheHandler();
|
||||
|
||||
if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates)
|
||||
if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) // each program has it's own type
|
||||
{
|
||||
if (Program2)
|
||||
Driver->irrGlUseProgram(Program2);
|
||||
@@ -572,6 +572,23 @@ void COpenGLSLMaterialRenderer::setBasicRenderStates(const SMaterial& material,
|
||||
Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates);
|
||||
}
|
||||
|
||||
void COpenGLSLMaterialRenderer::startUseProgram()
|
||||
{
|
||||
if (Program2)
|
||||
Driver->irrGlUseProgram(Program2);
|
||||
else if (Program)
|
||||
Driver->extGlUseProgramObject(Program);
|
||||
}
|
||||
|
||||
void COpenGLSLMaterialRenderer::stopUseProgram()
|
||||
{
|
||||
// Not going to reset irrGlUseProgram/extGlUseProgramObject as it shouldn't really matter
|
||||
|
||||
// Force reset of material to ensure OnSetMaterial will be called or we can miss
|
||||
// the next UseProgram call
|
||||
Driver->DoResetRenderStates();
|
||||
}
|
||||
|
||||
s32 COpenGLSLMaterialRenderer::getVertexShaderConstantID(const c8* name)
|
||||
{
|
||||
return getPixelShaderConstantID(name);
|
||||
|
Reference in New Issue
Block a user