Esempio n. 1
0
 public static EffectData FromFile(string fileName)
 {
     EffectData data = new EffectData();
     data.fileName = fileName;
     data.dxEffect = ResourceCache.Instance.GetDxEffect(fileName);
     return data;
 }
Esempio n. 2
0
 public void Dispose()
 {
     this.environment = null;
     this.explosions.Clear();
     this.device = null;
     this.currentEffect = null;
     this.asteroids.Clear();
     //this.
 }
Esempio n. 3
0
 public void SetEffect(string effectName)
 {
     if (currentEffect == null || currentEffect.FileName != effectName)
     {
         EffectData effect = ResourceCache.Instance.GetEffect(effectName);
         if (effect.ParamHandles == null)
         {
             effect.ParamHandles = this.ShaderConstants.GetParameters(effect.DxEffect);
         }
         this.ShaderConstants.SetEffectParameters(effect.DxEffect, effect.ParamHandles);
         currentEffect = effect;
     }
     else
     {
         this.ShaderConstants.SetEffectParameters(currentEffect.DxEffect, currentEffect.ParamHandles);
     }
 }
Esempio n. 4
0
 public void SetEffect(EffectData effect)
 {
     if (currentEffect != effect)
     {
         if (effect.ParamHandles == null)
         {
             effect.ParamHandles = this.ShaderConstants.GetParameters(effect.DxEffect);
         }
         this.ShaderConstants.SetEffectParameters(effect.DxEffect, effect.ParamHandles);
         currentEffect = effect;
     }
     else
     {
         this.ShaderConstants.SetEffectParameters(effect.DxEffect, effect.ParamHandles);
     }
 }
Esempio n. 5
0
 public void SetParameters(EffectData effect)
 {
     SetEffectParameters(effect.DxEffect, effect.ParamHandles);
 }