Пример #1
0
 public static EffectData FromFile(string fileName)
 {
     EffectData data = new EffectData();
     data.fileName = fileName;
     data.dxEffect = ResourceCache.Instance.GetDxEffect(fileName);
     return data;
 }
Пример #2
0
 public void Dispose()
 {
     this.environment = null;
     this.explosions.Clear();
     this.device = null;
     this.currentEffect = null;
     this.asteroids.Clear();
     //this.
 }
Пример #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);
     }
 }
Пример #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);
     }
 }
Пример #5
0
 public void SetParameters(EffectData effect)
 {
     SetEffectParameters(effect.DxEffect, effect.ParamHandles);
 }