当前位置: 首页>>代码示例>>C#>>正文


C# IEffect类代码示例

本文整理汇总了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();
 }
开发者ID:RedpointGames,项目名称:Protogame,代码行数:7,代码来源:NullRenderBatcher.cs

示例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;
			}
		}
开发者ID:ratsil,项目名称:bethe.btl,代码行数:26,代码来源:Transition.cs

示例3: Render

        public void Render(IEffect effect)
        {
            effect.SetTexture("tex0", _noTexture);
            effect.CommitChanges();

            _vertexRenderer.RenderForShader(PrimitiveType.LineList, 0, 3);
        }
开发者ID:HaKDMoDz,项目名称:Psy,代码行数:7,代码来源:CoordinateMarkerRenderer.cs

示例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();
        }
开发者ID:Daramkun,项目名称:Misty,代码行数:27,代码来源:Sprite.cs

示例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;
        }
开发者ID:Daramkun,项目名称:ProjectLiqueur,代码行数:30,代码来源:Sprite.cs

示例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);
            }
        }
开发者ID:HaKDMoDz,项目名称:Psy,代码行数:26,代码来源:ModelInstanceRenderer.cs

示例7: IsEffectPrevented

 private bool IsEffectPrevented(IEffect effect)
 {
     foreach (EffectSupport support in effectSupports)
         if (support(effect))
             return true;
     return false;
 }
开发者ID:Owen4ever,项目名称:Monicais.Game.Framework,代码行数:7,代码来源:PropertyImpl.cs

示例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();
 }
开发者ID:RedpointGames,项目名称:Protogame,代码行数:7,代码来源:Null3DRenderUtilities.cs

示例9: AddEffect

        public void AddEffect(IEffect effect)
        {
            if (effect == null)
                throw new ArgumentNullException("effect");

            game.AddEffect(effect);
        }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:7,代码来源:StateBase.cs

示例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;
            }
开发者ID:ratsil,项目名称:bethe.btl,代码行数:8,代码来源:Playlist.cs

示例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);
 }
开发者ID:zakvdm,项目名称:Frenetic,代码行数:8,代码来源:RocketLauncherViewTests.cs

示例12: Raise

		public void Raise(IEffect effect)
		{
			effect.TimeToStart= mCurrentTime + effect.Delay;
			effect.TimeToEnd = effect.TimeToStart + effect.Length;

			mQueuedEffects.Add(effect);
			++mNoOfQueuedEffects;
		}
开发者ID:tgsstdio,项目名称:BirdNest.Audio,代码行数:8,代码来源:EffectScheduler.cs

示例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;
        }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:9,代码来源:EffectHandle.cs

示例14: Equals

        public override bool Equals(IEffect other)
        {
            var otherEffect = other as RestoreEnergyEffect;
            if (otherEffect == null)
            {
                return false;
            }

            return Magnitude.Equals(otherEffect.Magnitude);
        }
开发者ID:ServerGame,项目名称:NullQuest,代码行数:10,代码来源:RestoreEnergyEffect.cs

示例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;
 }
开发者ID:Owen4ever,项目名称:Monicais.Game.Framework,代码行数:10,代码来源:PropertyImpl.cs


注:本文中的IEffect类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。