示例#1
0
		public TextureContext(Texture texture)
		{
			this.texture = texture;
		}
示例#2
0
		public IList<IResourceFileItem> Read(string filePath, IResourceFile resourceFile)
		{
			IList<IResourceFileItem> items = this.context.Resolve<IList<IResourceFileItem>>();

			var t = new Texture
				{
					BasePath = Path.GetDirectoryName(filePath),
					Name = Path.GetFileNameWithoutExtension(filePath),
					Image = LoadBitmap(filePath)
				};
			items.Add(new ResourceFileItem(Texture.TypeHash, t));
			return items;
		}
示例#3
0
		public void SetTexture(int channel, Texture texture)
		{
			if (texture == null)
			{
				GL.ActiveTexture(TextureUnit.Texture0 + channel);
				GL.Disable(EnableCap.Texture2D);
				this.isTextureSet[channel] = false;
				return;
			}
			this.isTextureSet[channel] = true;
			var textureContext = texture.ContextData as TextureContext;
			if (textureContext == null)
			{
				textureContext = new TextureContext(texture);
				texture.ContextData = textureContext;
			}
			textureContext.ApplyToChannel(channel);
		}