Пример #1
0
        /// <summary>
        /// テクスチャの削除を行います。
        /// </summary>
        private void Dispose(bool disposing)
        {
            if (!this.disposed)
            {
                if (TextureName != 0)
                {
                    TextureDisposer.AddDeleteTexture(this.context, TextureName);
                    this.glTexture = 0;
                }

                RemoveTexture(this);

                this.disposed = true;
            }
        }
Пример #2
0
        /// <summary>
        /// テクスチャを削除します。
        /// </summary>
        public void Destroy()
        {
            ValidateContext();

            if (this.glTexture != 0)
            {
                TextureDisposer.AddDeleteTexture(this.context, this.glTexture);
                this.glTexture = 0;
            }

            Width                = 0;
            Height               = 0;
            OriginalWidth        = 0;
            OriginalHeight       = 0;
            IsPremultipliedAlpha = false;
        }
Пример #3
0
        /// <summary>
        /// シングルトンインスタンスを取得します。
        /// </summary>
        public static TextureDisposer GetInstance(IGraphicsContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            lock (syncInstance)
            {
                TextureDisposer instance;
                if (instanceDic.TryGetValue(context, out instance))
                {
                    return(instance);
                }

                instance = new TextureDisposer(context);
                instanceDic.Add(context, instance);
                return(instance);
            }
        }