void Effect::SetParam(const string& name, I32 data) { auto it = scalarVars.find(name); _ASSERT(it != scalarVars.end()); ID3DX11EffectScalarVariable* scalarVar = it->second; DXCall(scalarVar->SetInt(data)); }
void EffectSystemD3D11::UpdateInt(int effectID, const char *name, int data) { ID3DX11EffectScalarVariable *integerVariable = mEffects[effectID]->GetVariableByName(name)->AsScalar(); if (integerVariable->IsValid()) { integerVariable->SetInt(data); } else { LogSystem::GetInstance().Log("effect integer「%s」非法", name); return; } }