예제 #1
0
        protected override void Dispose(bool isDisposing)
        {
            base.Dispose(isDisposing);

            all_textures.Remove(this);

            while (tryGetNextUpload(out var upload))
            {
                upload.Dispose();
            }

            GLWrapper.ScheduleDisposal(texture =>
            {
                int disposableId = texture.textureId;

                if (disposableId <= 0)
                {
                    return;
                }

                GL.DeleteTextures(1, new[] { disposableId });

                texture.memoryLease?.Dispose();

                texture.textureId = 0;
            }, this);
        }
예제 #2
0
        protected override void Dispose(bool isDisposing)
        {
            base.Dispose(isDisposing);

            memoryLease?.Dispose();

            GLWrapper.ScheduleDisposal(unload);
        }
예제 #3
0
        public void Dispose()
        {
            if (referenceCount.Decrement() != 0)
            {
                return;
            }

            GLWrapper.ScheduleDisposal(() => Dispose(true));
            GC.SuppressFinalize(this);
        }
예제 #4
0
        public void Dispose()
        {
            if (Interlocked.Decrement(ref referenceCount) != 0)
            {
                return;
            }

            GLWrapper.ScheduleDisposal(node => node.Dispose(true), this);
            GC.SuppressFinalize(this);
        }
예제 #5
0
 protected void Dispose(bool disposing) => GLWrapper.ScheduleDisposal(() =>
 {
     if (disposing)
     {
         foreach (VertexBuffer <T> vbo in VertexBuffers)
         {
             vbo.Dispose();
         }
     }
 });
예제 #6
0
        protected override void Dispose(bool isDisposing)
        {
            base.Dispose(isDisposing);

            while (uploadQueue.TryDequeue(out TextureUpload u))
            {
                u.Dispose();
            }

            GLWrapper.ScheduleDisposal(unload);
        }
예제 #7
0
        protected override void Dispose(bool isDisposing)
        {
            base.Dispose(isDisposing);

            while (tryGetNextUpload(out var upload))
            {
                upload.Dispose();
            }

            GLWrapper.ScheduleDisposal(unload);
        }
예제 #8
0
        protected override void Dispose(bool isDisposing)
        {
            base.Dispose(isDisposing);

            if (isDisposed)
                return;

            isDisposed = true;

            GLWrapper.ScheduleDisposal(() => base.TextureGL.Dereference());
        }
예제 #9
0
        protected virtual void Dispose(bool disposing)
        {
            if (isDisposed)
                return;
            isDisposed = true;

            GLWrapper.ScheduleDisposal(delegate
            {
                GLWrapper.DeleteFramebuffer(frameBuffer);
                frameBuffer = -1;
            });
        }
예제 #10
0
        protected virtual void Dispose(bool disposing) => GLWrapper.ScheduleDisposal(() =>
        {
            if (IsDisposed)
                return;

            if (isInitialised)
            {
                Unbind();
                GL.DeleteBuffer(vboId);
            }

            IsDisposed = true;
        });
예제 #11
0
        protected virtual void Dispose(bool disposing) => GLWrapper.ScheduleDisposal(() =>
        {
            if (IsLoaded)
            {
                IsLoaded = false;

                Unbind();
                GL.DeleteProgram(this);

                GlobalPropertyManager.Unregister(this);

                programID = -1;
            }
        });
예제 #12
0
        protected override void Dispose(bool isDisposing)
        {
            base.Dispose(isDisposing);

            memoryLease?.Dispose();

            GLWrapper.ScheduleDisposal(v =>
            {
                int[] ids = v.textureIds;

                if (ids == null)
                {
                    return;
                }

                for (int i = 0; i < ids.Length; i++)
                {
                    if (ids[i] >= 0)
                    {
                        GL.DeleteTextures(1, new[] { ids[i] });
                    }
                }
            }, this);
        }
예제 #13
0
 public void Dispose()
 {
     GLWrapper.ScheduleDisposal(d => d.Dispose(true), this);
     GC.SuppressFinalize(this);
 }
예제 #14
0
 protected virtual void Dispose(bool isDisposing) => GLWrapper.ScheduleDisposal(() => Available = false);
예제 #15
0
 protected virtual void Dispose(bool isDisposing)
 {
     GLWrapper.ScheduleDisposal(t => t.Available = false, this);
 }
예제 #16
0
 protected void Dispose(bool disposing) => GLWrapper.ScheduleDisposal(delete);