示例#1
0
 private static void FillImage(Image customImage)
 {
     var colors = new Color[8 * 8];
     for (int i = 0; i < 8 * 8; i++)
         colors[i] = Color.GetRandomColor();
     customImage.Fill(colors);
 }
示例#2
0
 public void CreateBuffer()
 {
     buffer2D = new MockCircularBuffer(Resolve<Device>(),
         ContentLoader.Load<ShaderWithFormat>(Shader.Position2DUV), BlendMode.Normal,
         VerticesMode.Triangles);
     buffer3D = new MockCircularBuffer(Resolve<Device>(),
         ContentLoader.Load<ShaderWithFormat>(Shader.Position3DUV), BlendMode.Normal,
         VerticesMode.Triangles);
     image = ContentLoader.Load<Image>("DeltaEngineLogo");
     Assert.IsTrue(buffer2D.IsCreated);
 }
示例#3
0
 public override void SetLightmapTexture(Image texture)
 {
 }
示例#4
0
 public override void SetDiffuseTexture(Image texture)
 {
 }
示例#5
0
		public void CreateAnimationWithEmptyTextures()
		{
			var emptyImageList = new Image[0];
			Assert.Throws<ImageAnimation.NoImagesGivenNeedAtLeastOne>(
				() => new ImageAnimation(emptyImageList, 3));
		}
		public override void SetLightmapTexture(Image texture)
		{
			context.PixelShader.SetShaderResource(1, (texture as SharpDXImage).NativeResourceView);
		}
		public override void SetDiffuseTexture(Image image)
		{
			context.PixelShader.SetShaderResource(0, (image as SharpDXImage).NativeResourceView);
			var sampler = GetSamplerState(!image.DisableLinearFiltering, image.AllowTiling);
			context.PixelShader.SetSampler(0, sampler);
		}
示例#8
0
		public override void SetDiffuseTexture(Image texture)
		{
			device.SetDiffuseTexture(texture);
		}
		public SpriteSheetAnimationCreationData(Image image, float duration, Size subImageSize)
		{
			Image = image;
			DefaultDuration = duration;
			SubImageSize = subImageSize;
		}
示例#10
0
			public ColoredSprite(Image image)
				: base(image) {}
示例#11
0
			protected Sprite(Image image)
			{
				Material = new Material(ContentLoader.Create<Shader>(
					new ShaderCreationData(ShaderFlags.Position2DColoredTextured)), image);
				OnDraw<DrawSprite>();
			}
示例#12
0
			public SolidSprite(Image image)
				: base(image) {}
		public override void SetLightmapTexture(Image texture)
		{
			Core.Logger.Info("Lightmaps are not supported yet in XNA");
		}
示例#14
0
 public Sprite(Image image)
 {
     material = new Material(ContentLoader.Load<Shader>(Shader.Position2DColorUV), image,
         image.PixelSize);
     OnDraw<DrawSprite>();
 }
示例#15
0
 public abstract void SetLightmapTexture(Image texture);
示例#16
0
 public abstract void SetDiffuseTexture(Image texture);