public TextureContext(Texture texture) { this.texture = texture; }
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; }
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); }