effect parameter setting

This commit is contained in:
Chris Forbes
2010-02-15 19:00:10 +13:00
parent 928549bfd8
commit 09ee4ee50d
2 changed files with 15 additions and 5 deletions

View File

@@ -238,8 +238,18 @@ namespace OpenRa.GlRenderer
CgGl.cgGLDisableProfile(dev.vertexProfile);
}
public void SetValue(string param, Texture texture) { }
public void SetValue<T>(string param, T t) where T : struct { }
public void SetValue(string name, Texture texture)
{
var param = Cg.cgGetNamedEffectParameter(effect, name);
CgGl.cgGLSetTextureParameter(param, texture.texture);
}
public void SetValue(string name, float x, float y)
{
var param = Cg.cgGetNamedEffectParameter(effect, name);
CgGl.cgGLSetParameter2f(param, x, y);
}
public void Commit() { }
}