2019-01-12 12:52:58 +01:00
|
|
|
/*
|
|
|
|
* =====================================================================================
|
|
|
|
*
|
|
|
|
* Filename: ClientChunk.hpp
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
*
|
|
|
|
* Created: 12/01/2019 01:31:57
|
|
|
|
*
|
|
|
|
* Author: Quentin Bazin, <quent42340@gmail.com>
|
|
|
|
*
|
|
|
|
* =====================================================================================
|
|
|
|
*/
|
|
|
|
#ifndef CLIENTCHUNK_HPP_
|
|
|
|
#define CLIENTCHUNK_HPP_
|
|
|
|
|
2019-04-13 15:06:52 +02:00
|
|
|
#include <gk/gl/Drawable.hpp>
|
|
|
|
#include <gk/gl/Texture.hpp>
|
2019-01-12 12:52:58 +01:00
|
|
|
|
2019-01-13 14:17:13 +01:00
|
|
|
#include "Chunk.hpp"
|
2019-01-12 12:52:58 +01:00
|
|
|
#include "ChunkBuilder.hpp"
|
|
|
|
#include "Config.hpp"
|
|
|
|
|
2019-01-13 14:17:13 +01:00
|
|
|
class ClientChunk : public Chunk {
|
2019-01-12 12:52:58 +01:00
|
|
|
public:
|
2019-01-13 14:17:13 +01:00
|
|
|
ClientChunk(s32 x, s32 y, s32 z, gk::Texture &texture)
|
|
|
|
: Chunk(x, y, z), m_texture(texture) {}
|
2019-01-12 12:52:58 +01:00
|
|
|
|
|
|
|
void update();
|
|
|
|
|
2019-01-12 19:38:30 +01:00
|
|
|
void drawLayer(gk::RenderTarget &target, gk::RenderStates states, u8 layer) const;
|
2019-01-12 12:52:58 +01:00
|
|
|
|
2019-01-12 19:38:30 +01:00
|
|
|
private:
|
2019-01-12 12:52:58 +01:00
|
|
|
gk::Texture &m_texture;
|
|
|
|
|
|
|
|
ChunkBuilder m_builder;
|
|
|
|
|
2019-01-19 15:21:49 +01:00
|
|
|
std::array<gk::VertexBuffer, ChunkBuilder::layers> m_vbo{};
|
|
|
|
std::array<std::size_t, ChunkBuilder::layers> m_verticesCount{};
|
2019-01-12 12:52:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CLIENTCHUNK_HPP_
|