voxel-engine/include/chunkmesher.hpp

34 lines
762 B
C++
Raw Normal View History

#ifndef CHUNKMESH_H
#define CHUNKMESH_H
2023-03-23 21:17:06 +01:00
#include <string>
#include <vector>
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <oneapi/tbb/concurrent_queue.h>
#include "chunk.hpp"
#include "globals.hpp"
#include "shader.hpp"
namespace chunkmesher{
struct MeshData{
Chunk::Chunk* chunk;
GLuint numVertices{0};
std::vector<GLubyte> vertices;
std::vector<GLubyte> extents;
std::vector<GLubyte> texinfo;
};
oneapi::tbb::concurrent_queue<MeshData*>& getMeshDataQueue();
void mesh(Chunk::Chunk* chunk);
void sendtogpu(MeshData* mesh_data);
void quad(MeshData* mesh_data, glm::vec3 bottomLeft, glm::vec3 topLeft, glm::vec3 topRight,
glm::vec3 bottomRight, glm::vec3 normal, Block block, int dim, bool backFace);
}
#endif