OpenMiner/include/world/World.hpp

42 lines
797 B
C++
Raw Normal View History

2014-12-18 07:02:48 +01:00
/*
* =====================================================================================
*
* Filename: World.hpp
*
2018-06-05 01:24:54 +02:00
* Description:
2014-12-18 07:02:48 +01:00
*
* Created: 16/12/2014 15:28:02
*
* Author: Quentin Bazin, <quent42340@gmail.com>
2014-12-18 07:02:48 +01:00
*
* =====================================================================================
*/
#ifndef WORLD_HPP_
#define WORLD_HPP_
#include <memory>
#include "Chunk.hpp"
class World {
public:
World();
2018-06-05 01:24:54 +02:00
2014-12-29 03:14:09 +01:00
void draw(Shader &shader, const glm::mat4 &projectionMatrix, const glm::mat4 &viewMatrix);
2018-06-05 01:24:54 +02:00
2014-12-20 15:13:51 +01:00
Chunk *getChunk(s32 x, s32 z);
2018-06-05 01:24:54 +02:00
2014-12-23 16:15:44 +01:00
// Render distance in chunks
2015-02-06 01:44:16 +01:00
static const u16 renderDistance = 8;
2018-06-05 01:24:54 +02:00
2014-12-18 07:02:48 +01:00
private:
s32 m_width;
s32 m_depth;
2018-06-05 01:24:54 +02:00
2015-02-06 01:44:16 +01:00
Texture m_texture;
2018-06-05 01:24:54 +02:00
2014-12-18 07:02:48 +01:00
std::vector<std::unique_ptr<Chunk>> m_chunks;
};
#endif // WORLD_HPP_