Beispiel #1
0
        protected void Dispose(bool disposing)
        {
            if (mDisposed)
            {
                return;
            }

            if (disposing)
            {
                PositionBuffer?.Dispose();
                NormalBuffer?.Dispose();
                TangentBuffer?.Dispose();
                TexCoord0Buffer?.Dispose();
                TexCoord1Buffer?.Dispose();
                Color0Buffer?.Dispose();

                foreach (var subMesh in SubMeshes)
                {
                    subMesh.Dispose();
                }
            }

            GL.DeleteVertexArray(VertexArrayId);
            GL.Finish();

            mDisposed = true;
        }
Beispiel #2
0
 private void OnDisable()
 {
     Tribuffer.Release();
     Tribuffer.Dispose();
     PosBuffer.Release();
     PosBuffer.Dispose();
     NormalBuffer.Release();
     NormalBuffer.Dispose();
     IndexBuffer.Release();
     IndexBuffer.Dispose();
     CountBuffer.Release();
     CountBuffer.Dispose();
 }
Beispiel #3
0
        private bool mDisposed = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!mDisposed)
            {
                if (disposing)
                {
                    PositionBuffer.Dispose();
                    NormalBuffer?.Dispose();
                    TextureCoordinateChannel0Buffer?.Dispose();
                    ElementBuffer.Dispose();
                    GL.DeleteVertexArray(Id);
                }

                mDisposed = true;
            }
        }
Beispiel #4
0
        protected void Dispose(bool disposing)
        {
            if (disposing)
            {
                PositionBuffer?.Dispose();
                NormalBuffer?.Dispose();
                TangentBuffer?.Dispose();
                TexCoordBuffer?.Dispose();
                TexCoord2Buffer?.Dispose();
                ColorBuffer?.Dispose();

                foreach (var indexTable in IndexTables)
                {
                    indexTable.Dispose();
                }
            }

            GL.DeleteVertexArray(VertexArrayID);
        }
Beispiel #5
0
 public void Dispose()
 {
     VertexBuffer.Dispose();
     NormalBuffer.Dispose();
     IndexBuffer.Dispose();
 }