]> git.localhorst.tv Git - blank.git/blob - src/world/ChunkRenderer.hpp
more fun with AI/steering
[blank.git] / src / world / ChunkRenderer.hpp
1 #ifndef BLANK_WORLD_CHUNKRENDERER_HPP_
2 #define BLANK_WORLD_CHUNKRENDERER_HPP_
3
4 #include "Block.hpp"
5 #include "Chunk.hpp"
6 #include "../graphics/ArrayTexture.hpp"
7 #include "../graphics/BlockMesh.hpp"
8
9 #include <vector>
10
11
12 namespace blank {
13
14 class AssetLoader;
15 class BlockMesh;
16 class ChunkIndex;
17 class ResourceIndex;
18 class Viewport;
19
20 class ChunkRenderer {
21
22 public:
23         explicit ChunkRenderer(ChunkIndex &);
24         ~ChunkRenderer();
25
26         void LoadTextures(const AssetLoader &, const ResourceIndex &);
27         void FogDensity(float d) noexcept { fog_density = d; }
28
29         int MissingChunks() const noexcept;
30
31         void Update(int dt);
32
33         void Render(Viewport &);
34
35 private:
36         ChunkIndex &index;
37         std::vector<BlockMesh> models;
38
39         ArrayTexture block_tex;
40
41         float fog_density;
42
43 };
44
45 }
46
47 #endif