Beispiel #1
0
 public void Render()
 {
     if (Disposed)
     {
         return;
     }
     if (_needUpdate)
     {
         lock (_updateLock)
         {
             _vertex?.DisposeAll();
             _vertex = _chunkVertexArrayProvider.ToElementArray().GetHandle();
             _chunkVertexArrayProvider = null;
             _needUpdate = false;
         }
     }
     lock (_renderLock)
     {
         if (_vertex == null || _shader == null)
         {
             return;
         }
         _textureDictionary.Bind();
         _shader.Use();
         _shader.Model      = Matrix4.Identity;
         _shader.Projection = _projectionMatrix.GetMatrix();
         _shader.View       = _viewMatrix.GetMatrix();
         _vertex.Bind();
         _vertex.Render();
     }
 }
Beispiel #2
0
 public void Dispose()
 {
     (_shader as IDisposable)?.Dispose();
     _eah?.DisposeAll();
 }