- Added missing methods for Cg interface.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4323 dfc29bdd-3216-0410-991c-e03cc46cb475
master
Nadro 2012-10-03 18:25:19 +00:00
parent 5a265656cc
commit f8d77add00
2 changed files with 24 additions and 0 deletions

View File

@ -195,6 +195,11 @@ bool CCgMaterialRenderer::setVertexShaderConstant(const c8* name, const f32* flo
return setPixelShaderConstant(name, floats, count);
}
bool CCgMaterialRenderer::setVertexShaderConstant(const c8* name, const bool* bools, int count)
{
return setPixelShaderConstant(name, bools, count);
}
bool CCgMaterialRenderer::setVertexShaderConstant(const c8* name, const s32* ints, int count)
{
return setPixelShaderConstant(name, ints, count);
@ -239,6 +244,23 @@ bool CCgMaterialRenderer::setPixelShaderConstant(const c8* name, const s32* ints
return Status;
}
bool CCgMaterialRenderer::setPixelShaderConstant(const c8* name, const bool* bools, int count)
{
bool Status = false;
for(unsigned int i = 0; i < UniformInfo.size(); ++i)
{
if(UniformInfo[i]->getName() == name)
{
UniformInfo[i]->update(bools, Material);
Status = true;
}
}
return Status;
}
void CCgMaterialRenderer::getUniformList()
{
for(unsigned int i = 0; i < UniformInfo.size(); ++i)

View File

@ -140,9 +140,11 @@ public:
virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates) = 0;
virtual bool setVertexShaderConstant(const c8* name, const f32* floats, int count);
virtual bool setVertexShaderConstant(const c8* name, const bool* bools, int count);
virtual bool setVertexShaderConstant(const c8* name, const s32* ints, int count);
virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1);
virtual bool setPixelShaderConstant(const c8* name, const f32* floats, int count);
virtual bool setPixelShaderConstant(const c8* name, const bool* bools, int count);
virtual bool setPixelShaderConstant(const c8* name, const s32* ints, int count);
virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1);
virtual IVideoDriver* getVideoDriver() = 0;