ChunkRenderer.h 791 B

123456789101112131415161718192021222324252627282930
  1. #ifndef CHUNKRENDERER_H
  2. #define CHUNKRENDERER_H
  3. #include "../../engine/Mesh.h"
  4. #include "../../engine/Shader.h"
  5. #include "../../engine/Texture.h"
  6. #include "../../engine/DirectRenderer.h"
  7. #include "../../world/IChunkListener.h"
  8. #include "../../math/Camera3D.h"
  9. class ChunkRenderer : public IChunkListener
  10. {
  11. public:
  12. ChunkRenderer();
  13. virtual ~ChunkRenderer();
  14. void renderTick(Shader& shader, Camera3D camera, DirectRenderer& dr, float lag);
  15. void updateChunk(Chunk& c, Chunk* north, Chunk* east, Chunk* south, Chunk* west) override;
  16. private:
  17. void buildChunk(int partionY, Chunk& c, Chunk* north, Chunk* east, Chunk* south, Chunk* west);
  18. const int chunkX = 32;
  19. const int chunkZ = 32;
  20. NormalTextureMesh* mesh;
  21. Texture blockTexture;
  22. };
  23. #endif