public void DisposeTex(IGeneratedTexture tex) { if (tex == null) { return; } if (tex is MyUserGeneratedTexture) { MyUserGeneratedTexture texture = (MyUserGeneratedTexture)tex; texture.Dispose(); m_objectsPoolGenerated.Deallocate(texture); tex = null; } else if (tex is MyGeneratedTextureFromPattern) { MyGeneratedTextureFromPattern texture = (MyGeneratedTextureFromPattern)tex; texture.Dispose(); m_objectsPoolGeneratedFromPattern.Deallocate(texture); tex = null; } else { MyRenderProxy.Assert(false, "It is disposed texture that does not belong to this manager"); } }
internal static void ResetUserTexture(MyUserGeneratedTexture texture, byte[] data) { switch (texture.Format) { case Format.R8G8B8A8_UNorm: case Format.R8G8B8A8_UNorm_SRgb: Reset(texture, data, 4); break; case Format.R8_UNorm: Reset(texture, data, 1); break; default: throw new Exception(); } }