A game framework written with osu! in mind.
at master 30 lines 945 B view raw
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. 2// See the LICENCE file in the repository root for full licence text. 3 4using osu.Framework.Graphics.OpenGL.Textures; 5using osuTK.Graphics.ES30; 6 7namespace osu.Framework.Graphics.Textures 8{ 9 /// <summary> 10 /// A texture which can cleans up any resources held by the underlying <see cref="TextureGL"/> on <see cref="Dispose"/>. 11 /// </summary> 12 public class DisposableTexture : Texture 13 { 14 public DisposableTexture(TextureGL textureGl) 15 : base(textureGl) 16 { 17 } 18 19 public DisposableTexture(int width, int height, bool manualMipmaps = false, All filteringMode = All.Linear) 20 : base(width, height, manualMipmaps, filteringMode) 21 { 22 } 23 24 protected override void Dispose(bool isDisposing) 25 { 26 base.Dispose(isDisposing); 27 TextureGL.Dispose(); 28 } 29 } 30}