Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ComputeTextureColor" /> class.
 /// </summary>
 /// <param name="texture">The texture.</param>
 /// <param name="texcoordIndex">Index of the texcoord.</param>
 /// <param name="scale">The scale.</param>
 /// <param name="offset">The offset.</param>
 protected ComputeTextureBase(Texture texture, TextureCoordinate texcoordIndex, Vector2 scale, Vector2 offset)
 {
     Texture = texture;
     TexcoordIndex = texcoordIndex;
     Sampler = new ComputeColorParameterSampler();
     Scale = scale;
     Offset = offset;
     Key = null;
 }
        public ObjectParameterKey <SamplerState> GetSamplerKey(ComputeColorParameterSampler sampler)
        {
            if (sampler == null)
            {
                throw new ArgumentNullException("sampler");
            }

            var samplerStateDesc = new SamplerStateDescription(sampler.Filtering, sampler.AddressModeU)
            {
                AddressV = sampler.AddressModeV,
                AddressW = TextureAddressMode.Wrap
            };

            return(GetSamplerKey(samplerStateDesc, graphicsDevice));
        }
        public ObjectParameterKey<SamplerState> GetSamplerKey(ComputeColorParameterSampler sampler)
        {
            if (sampler == null) throw new ArgumentNullException("sampler");

            var samplerStateDesc = new SamplerStateDescription(sampler.Filtering, sampler.AddressModeU)
            {
                AddressV = sampler.AddressModeV,
                AddressW = TextureAddressMode.Wrap
            };
            return GetSamplerKey(samplerStateDesc, graphicsDevice);
        }