Esempio n. 1
0
 public void Dispose()
 {
     _vertexLitEffect = null;
     if (_mesh != null)
     {
         _mesh.Dispose();
     }
     _disposed = true;
 }
Esempio n. 2
0
        public ChunkMesh(Vector3 modelOrigin, [NotNull] VertexLitEffect vertexLitEffect, [CanBeNull] Buffer <VertexPositionColorTexture> mainBuffer = null)
        {
            if (vertexLitEffect == null)
            {
                throw new ArgumentNullException("vertexLitEffect");
            }

            _vertexLitEffect = vertexLitEffect;
            ModelOrigin      = modelOrigin;
            _world           = Matrix.Identity;
            if (mainBuffer != null)
            {
                _mesh = new Mesh <VertexPositionColorTexture>(mainBuffer, _vertexLitEffect.Effect);
            }
        }