/*------------------------------------- * NON-PUBLIC METHODS *-----------------------------------*/ protected virtual void Dispose(bool disposing) { if (disposing) { foreach (var texture in m_Textures) { texture.Dispose(); } m_Textures.Clear(); m_Textures = null; m_White = null; m_Graphics = null; } }
/*------------------------------------- * PUBLIC METHODS *-----------------------------------*/ public SharpDXTexture CreateTexture(int width, int height) { var texDesc = new Texture2DDescription { ArraySize = 1, BindFlags = BindFlags.ShaderResource, Format = Format.R16G16B16A16_Float, MipLevels = 1, SampleDescription = new SampleDescription(1, 0), Width = width, Height = height }; var device = m_Graphics.Device; var gpuTex = new Texture2D(device, texDesc); var tex = new SharpDXTexture(m_Graphics, gpuTex, width, height); m_Textures.Add(tex); return(tex); }