2023-02-12 14:36:59 +01:00
|
|
|
#ifndef CHUNKMESH_H
|
|
|
|
#define CHUNKMESH_H
|
|
|
|
|
2023-03-23 21:17:06 +01:00
|
|
|
#include <string>
|
2023-02-12 14:36:59 +01:00
|
|
|
#include <vector>
|
|
|
|
|
2023-05-20 21:19:44 +02:00
|
|
|
#include <glad/glad.h>
|
2023-10-04 12:10:33 +02:00
|
|
|
#include <glm/glm.hpp>
|
2023-05-20 21:19:44 +02:00
|
|
|
#include <GLFW/glfw3.h>
|
|
|
|
#include <oneapi/tbb/concurrent_queue.h>
|
|
|
|
|
2023-02-12 14:36:59 +01:00
|
|
|
#include "chunk.hpp"
|
2023-10-04 12:10:33 +02:00
|
|
|
#include "chunkmeshdata.hpp"
|
2023-02-12 14:36:59 +01:00
|
|
|
#include "globals.hpp"
|
|
|
|
#include "shader.hpp"
|
2023-03-03 21:33:11 +01:00
|
|
|
|
|
|
|
namespace chunkmesher{
|
2023-05-20 21:19:44 +02:00
|
|
|
struct MeshData{
|
|
|
|
Chunk::Chunk* chunk;
|
2023-05-26 23:05:29 +02:00
|
|
|
GLuint numVertices{0};
|
|
|
|
|
2023-05-20 21:19:44 +02:00
|
|
|
std::vector<GLfloat> vertices;
|
2023-07-19 12:56:55 +02:00
|
|
|
std::vector<GLfloat> extents;
|
|
|
|
std::vector<GLfloat> texinfo;
|
2023-05-20 21:19:44 +02:00
|
|
|
};
|
2023-03-03 21:33:11 +01:00
|
|
|
|
2023-10-04 12:10:33 +02:00
|
|
|
ChunkMeshDataQueue& getMeshDataQueue();
|
|
|
|
void init();
|
2023-05-20 21:19:44 +02:00
|
|
|
void mesh(Chunk::Chunk* chunk);
|
2023-03-03 21:33:11 +01:00
|
|
|
}
|
2023-02-12 14:36:59 +01:00
|
|
|
|
|
|
|
|
2023-03-23 16:19:25 +01:00
|
|
|
#endif
|
2023-10-04 12:10:33 +02:00
|
|
|
|