Support startUseProgram in COGLES2MaterialRenderer

Not tested much, but seems to be easier in es2 than in normal OpenGL
Probably because it doesn't have to care about switching back to fixed function pipeline


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6478 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien 2023-04-27 20:02:09 +00:00
parent 23ebdbe978
commit e4bb544079
3 changed files with 10 additions and 0 deletions

@ -2375,7 +2375,10 @@ COGLES2Driver::~COGLES2Driver()
r->drop(); r->drop();
if (callback && nr >= 0) if (callback && nr >= 0)
{
r->startUseProgram();
callback->OnCreate(r, userData); callback->OnCreate(r, userData);
}
return nr; return nr;
} }

@ -348,6 +348,11 @@ void COGLES2MaterialRenderer::setBasicRenderStates(const SMaterial& material,
Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates);
} }
void COGLES2MaterialRenderer::startUseProgram()
{
Driver->getCacheHandler()->setProgram(Program);
}
s32 COGLES2MaterialRenderer::getVertexShaderConstantID(const c8* name) s32 COGLES2MaterialRenderer::getVertexShaderConstantID(const c8* name)
{ {
return getPixelShaderConstantID(name); return getPixelShaderConstantID(name);

@ -55,6 +55,8 @@ public:
virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates) IRR_OVERRIDE; virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates) IRR_OVERRIDE;
virtual void startUseProgram() IRR_OVERRIDE;
virtual s32 getVertexShaderConstantID(const c8* name) IRR_OVERRIDE; virtual s32 getVertexShaderConstantID(const c8* name) IRR_OVERRIDE;
virtual s32 getPixelShaderConstantID(const c8* name) IRR_OVERRIDE; virtual s32 getPixelShaderConstantID(const c8* name) IRR_OVERRIDE;
virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) IRR_OVERRIDE; virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) IRR_OVERRIDE;