/// <summary> /// /// </summary> /// <param name="target"></param> /// <param name="storage"></param> /// <param name="mipmapBuilder"></param> /// <param name="texParameters"></param> public Texture(TextureTarget target, TexStorageBase storage, MipmapBuilder mipmapBuilder, params TexParameter[] texParameters) { this.Target = target; this.Storage = storage; this.mipmapBuilder = mipmapBuilder; this.builtInSampler.AddRange(texParameters); }
/// <summary> /// resources(bitmap etc.) can be disposed after this initialization. /// </summary> public void Initialize() { if (!this.initialized) { GL.Instance.GenTextures(1, ids); TextureTarget target = this.Target; GL.Instance.BindTexture((uint)target, ids[0]); this.builtInSampler.Apply(target); this.Storage.Apply(); MipmapBuilder mipmapBuilder = this.mipmapBuilder; if (mipmapBuilder != null) { mipmapBuilder.GenerateMipmmap((uint)target); } GL.Instance.BindTexture((uint)target, 0); this.initialized = true; } }