Botcraft 1.21.4
Loading...
Searching...
No Matches
BlockRenderable.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <deque>
4#include <mutex>
5
7
8namespace Botcraft
9{
10 namespace Renderer
11 {
12 // Status of a face buffer
13 enum class BufferStatus
14 {
15 Created, // The buffer is new, must be created in OpenGL
16 Updated, // The existing buffer has been updated
17 UpToDate, // The OpenGL buffer is up to date
18 };
19
21 {
22 public:
25
26 void Update();
27 void ClearFaces();
28 const unsigned int GetNumFace() const;
29 void Render() const;
30
31 protected:
33 void DeleteOpenGLBuffer();
34
35 protected:
36 unsigned int faces_VAO;
37 unsigned int faces_VBO;
38 unsigned int data_VBO;
39 unsigned int face_number;
40
41 std::deque<Face> faces;
42
44
45 std::mutex mutex_faces;
46 };
47 } // Renderer
48} // Botcraft
const unsigned int GetNumFace() const