Example #1
0
 internal void InitializeWithShader(BlockShader shader)
 {
     Disposed     = false;
     _shaderOwner = false;
     _shader      = shader;
     /*_shader.Model = Matrix4.Identity;*/
     _textureDictionary        = _textureAtlasProvider();
     _chunkVertexArrayProvider = new ChunkVertexArrayProvider(_chunk, _textureAtlasProvider);
     //Logger.GetLogger<ChunkRenderer>().Info($"Initalized {_chunk.X}, {_chunk.Z}");
 }
Example #2
0
 public void Initialize()
 {
     Disposed                  = false;
     _shader                   = new BlockShader();
     _shader.Model             = Matrix4.Identity;
     _textureDictionary        = _textureAtlasProvider();
     _chunkVertexArrayProvider = new ChunkVertexArrayProvider(_chunk, _textureAtlasProvider);
     Logger.GetLogger <ChunkRenderer>().Info($"Initalized {_chunk.X}, {_chunk.Z}");
     GenerateMeshes();
 }
Example #3
0
 public void Dispose()
 {
     if (Disposed)
     {
         return;
     }
     lock (_renderLock)
     {
         Disposed = true;
         if (_shaderOwner)
         {
             (_shader as IDisposable)?.Dispose();
         }
         _shader = null;
         _chunkVertexArrayProvider.StopCalculation();
         _chunkVertexArrayProvider = null;
     }
 }