예제 #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);
		}