public LTexture(string resName, Format format, bool multipyAlpha) { LTextureData data = GLLoader.GetTextureData(resName); data.SetMultipyAlpha(multipyAlpha); this.Init(data, format); }
public LTexture Pack(Loon.Core.Graphics.Opengl.LTexture.Format format) { if (texture != null && !packing) { return(texture); } if (fileName != null) { texture = new LTexture(GLLoader.GetTextureData(fileName), format); texture.isExt = true; } else { LImage image = PackImage(); if (image == null) { return(null); } if (texture != null) { texture.Destroy(); texture = null; } if (colorMask != null) { Color[] pixels = image.GetPixels(); int size = pixels.Length; uint color = colorMask.GetRGB(); for (int i = 0; i < size; i++) { if (pixels[i].PackedValue == color) { pixels[i].PackedValue = LSystem.TRANSPARENT; } } image.SetPixels(pixels, image.GetWidth(), image.GetHeight()); } texture = new LTexture(GLLoader.GetTextureData(image), format); texture.isExt = true; if (image != null) { image.Dispose(); image = null; } } return(texture); }
public LTexture(LImage pix, Format format) : this(GLLoader.GetTextureData(pix), format) { }
public LTexture(string res, Format format) : this(GLLoader.GetTextureData(res), format) { }