本文整理汇总了C#中IEffect类的典型用法代码示例。如果您正苦于以下问题:C# IEffect类的具体用法?C# IEffect怎么用?C# IEffect使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IEffect类属于命名空间,在下文中一共展示了IEffect类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateInstancedRequest
public IRenderRequest CreateInstancedRequest(IRenderContext renderContext, RasterizerState rasterizerState,
BlendState blendState, DepthStencilState depthStencilState, IEffect effect, IEffectParameterSet effectParameterSet,
VertexBuffer meshVertexBuffer, IndexBuffer meshIndexBuffer, PrimitiveType primitiveType,
Matrix[] instanceWorldTransforms, Action<List<Matrix>, VertexBuffer, IndexBuffer> computeCombinedBuffers)
{
throw new NotImplementedException();
}
示例2: Transition
public Transition(Effect cEffectSource, Effect cEffectTarget)
: this()
{
try
{
if (null == cEffectSource) // TODO проверять видео или только аудио.....
_cEffectSource = new Composite(1, 1);
else
_cEffectSource = cEffectSource;
if (null == cEffectTarget)
_cEffectTarget = new Composite(1, 1);
else
_cEffectTarget = cEffectTarget;
#region z-layer
if (_cEffectSource.nLayer > _cEffectTarget.nLayer)
((IEffect)this).nLayer = _cEffectTarget.nLayer;
else
((IEffect)this).nLayer = _cEffectSource.nLayer;
#endregion
}
catch
{
Fail();
throw;
}
}
示例3: Render
public void Render(IEffect effect)
{
effect.SetTexture("tex0", _noTexture);
effect.CommitChanges();
_vertexRenderer.RenderForShader(PrimitiveType.LineList, 0, 3);
}
示例4: Sprite
public Sprite( ITexture2D texture, IEffect effect )
{
if ( effect == null )
{
if ( baseSpriteEffect == null )
baseSpriteEffect = new SpriteEffect ();
effect = baseSpriteEffect;
}
if ( projectionMatrix == null )
projectionMatrix = new OrthographicOffCenterProjection ( 0, 800, 600, 0, 0.001f, 1000.0f );
Effect = effect;
if ( vertexDeclaration == null )
{
vertexDeclaration = Core.GraphicsDevice.CreateVertexDeclaration ( Utilities.CreateVertexElementArray<SpriteVertex> () );
}
indexReference++;
vertexBuffer = Core.GraphicsDevice.CreateBuffer ( BufferType.VertexBuffer, typeof ( SpriteVertex ), 4 );
textureArgument = new SamplerState ( texture, Graphics.TextureFilter.Nearest, TextureAddressing.Clamp, 0 );
Reset ( texture );
innerWorld = new World2();
}
示例5: Sprite
public Sprite( ITexture2D texture, IEffect effect )
{
if ( effect == null )
{
if ( baseSpriteEffect == null )
baseSpriteEffect = new SpriteEffect ();
effect = baseSpriteEffect;
}
Texture = texture;
Effect = effect;
int width = 1, height = 1;
if ( texture != null ) { width = texture.Width; height = texture.Height; }
vertexBuffer = LiqueurSystem.GraphicsDevice.CreateVertexBuffer<SpriteVertex> ( SpriteVertexFormat, new SpriteVertex []
{
new SpriteVertex ( new Vector2 ( 0.001f, 0.001f ), Color.White, new Vector2 ( 0.001f, 0.001f ) ),
new SpriteVertex ( new Vector2 ( width, 0.001f ), Color.White, new Vector2 ( 1, 0.001f ) ),
new SpriteVertex ( new Vector2 ( 0.001f, height ), Color.White, new Vector2 ( 0.001f, 1 ) ),
new SpriteVertex ( new Vector2 ( width, height ), Color.White, new Vector2 ( 1, 1 ) ),
} );
if ( indexBuffer == null )
indexBuffer = LiqueurSystem.GraphicsDevice.CreateIndexBuffer ( new int [] { 0, 1, 2, 1, 3, 2 } );
indexReference++;
clippingArea = new Rectangle ( 0, 0, width, height );
TextureFilter = Liqueur.Graphics.TextureFilter.Nearest;
}
示例6: Render
public void Render(ModelInstance modelInstance, IEffect effect)
{
foreach (var meshInstance in modelInstance.MeshInstances)
{
var renderer = GetRendererFor(meshInstance);
var dataStream = renderer.LockVertexBuffer();
dataStream.WriteRange(meshInstance.VertexBuffer);
renderer.UnlockVertexBuffer();
if (meshInstance.TextureArea == null)
{
meshInstance.TextureArea = _graphicsContext.GetTexture(meshInstance.TextureName);
}
if (meshInstance.TextureName != _lastTextureName)
{
_lastTextureName = meshInstance.TextureName;
effect.SetTexture("tex0", meshInstance.TextureArea);
effect.CommitChanges();
}
renderer.RenderForShader(PrimitiveType.TriangleList, 0, meshInstance.TriangleCount);
}
}
示例7: IsEffectPrevented
private bool IsEffectPrevented(IEffect effect)
{
foreach (EffectSupport support in effectSupports)
if (support(effect))
return true;
return false;
}
示例8: RenderText
public void RenderText(IRenderContext context, IEffect effect, IEffectParameterSet effectParameterSet, Matrix matrix,
string text, FontAsset font, HorizontalAlignment horizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment verticalAlignment = VerticalAlignment.Top, Color? textColor = null, bool renderShadow = true,
Color? shadowColor = null)
{
throw new NotSupportedException();
}
示例9: AddEffect
public void AddEffect(IEffect effect)
{
if (effect == null)
throw new ArgumentNullException("effect");
game.AddEffect(effect);
}
示例10: Item
public Item(IEffect iEffect, Transition.TypeVideo cTransitionVideo, Transition.TypeAudio cTransitionAudio, ushort nTransitionDuration)
{
this.iEffect = iEffect;
this.bIsActive = true;
this.cTransitionVideo = cTransitionVideo;
this.cTransitionAudio = cTransitionAudio;
this.nTransitionDuration = nTransitionDuration;
}
示例11: Setup
public void Setup()
{
stubWeapons = MockRepository.GenerateStub<IWeapons>();
stubWeapons.Stub(me => me[WeaponType.RocketLauncher]).Return(new RocketLauncher(null));
((RocketLauncher)stubWeapons[WeaponType.RocketLauncher]).Rockets.Add(new Rocket(Vector2.Zero, Vector2.Zero, new Frenetic.Physics.DummyPhysicsComponent()));
mockEffects = MockRepository.GenerateStub<IEffect>();
view = new RocketLauncherView(mockEffects);
}
示例12: Raise
public void Raise(IEffect effect)
{
effect.TimeToStart= mCurrentTime + effect.Delay;
effect.TimeToEnd = effect.TimeToStart + effect.Length;
mQueuedEffects.Add(effect);
++mNoOfQueuedEffects;
}
示例13: EffectHandle
public EffectHandle(IEffect effect, IChoice choice, ILimit limit)
{
if (effect == null)
throw new ArgumentNullException("effect");
this.effect = effect;
this.choice = choice;
this.limit = limit;
}
示例14: Equals
public override bool Equals(IEffect other)
{
var otherEffect = other as RestoreEnergyEffect;
if (otherEffect == null)
{
return false;
}
return Magnitude.Equals(otherEffect.Magnitude);
}
示例15: AddEffect
public override bool AddEffect(IEffect effect)
{
if (IsEffectPrevented(effect))
return false;
effectList.AddEffect(effect);
Invalidate();
if (effect.ID.Priority == EffectPriority.IMMEDIATE)
Validate();
return true;
}