Botcraft 26.3
Loading...
Searching...
No Matches
BlockRenderable.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <mutex>
4#include <vector>
5
7
8namespace Botcraft
9{
10 namespace Renderer
11 {
13 {
14 public:
16 virtual ~BlockRenderable();
17
20
21 void SetFaces(std::vector<Face>&& faces_);
22 void Update();
23 void ClearFaces();
24 const unsigned int GetNumFace() const;
25 void Render() const;
26
27 protected:
29 void DeleteOpenGLBuffer();
30
31 // Called with mutex_faces held, after the GPU buffer is current.
32 virtual void OnUploadedLocked();
33
34 protected:
35 unsigned int faces_VAO;
36 unsigned int faces_VBO;
37 unsigned int data_VBO;
38 unsigned int face_number;
39
40 std::vector<Face> faces;
41 bool dirty;
42
43 std::mutex mutex_faces;
44 };
45 } // Renderer
46} // Botcraft
void SetFaces(std::vector< Face > &&faces_)
const unsigned int GetNumFace() const
BlockRenderable(const BlockRenderable &)=delete
BlockRenderable & operator=(const BlockRenderable &)=delete