public static BaseTexture FromPool(string name) { if (BaseTexture.ExistsInPool(name)) { return(null); } return(BaseTexture.TexturePool[name]); }
public static BaseTexture FromBuffer(BaseDevice device, BaseTextureDesc desc, uint[] buffer, bool resample = false) { if (BaseTexture.ExistsInPool(desc.Name)) { return(BaseTexture.TexturePool[desc.Name]); } var texture = ( BaseTexture )Activator.CreateInstance(device.TextureType, device, desc); texture.Initialise(buffer); texture.Upload(resample); return(texture); }
public static BaseTexture FromBuffer(BaseDevice device, string identifier, uint[] buffer, int width, int height, bool hasMipMap, bool hasAlpha, string filter = "GL_LINEAR_MIPMAP_NEAREST", string blendMode = "", bool isLightMap = false) { if (BaseTexture.ExistsInPool(identifier)) { return(BaseTexture.TexturePool[identifier]); } var desc = ( BaseTextureDesc )Activator.CreateInstance(device.TextureDescType); desc.Name = identifier; desc.HasAlpha = hasAlpha; desc.Width = width; desc.Height = height; desc.HasMipMap = hasMipMap; desc.Filter = filter; desc.BlendMode = blendMode; desc.IsLightMap = isLightMap; return(BaseTexture.FromBuffer(device, desc, buffer)); }