2023-04-09 21:44:17 +02:00
|
|
|
#ifndef RENDERER_H
|
|
|
|
#define RENDERER_H
|
|
|
|
|
2023-04-29 14:54:43 +02:00
|
|
|
#include <oneapi/tbb/concurrent_unordered_set.h>
|
2023-05-20 21:19:44 +02:00
|
|
|
#include <oneapi/tbb/concurrent_queue.h>
|
2023-04-29 14:54:43 +02:00
|
|
|
|
|
|
|
#include "chunk.hpp"
|
2023-05-20 21:19:44 +02:00
|
|
|
#include "chunkmesher.hpp"
|
2023-10-04 12:10:33 +02:00
|
|
|
#include "chunkmeshdata.hpp"
|
2023-04-09 21:44:17 +02:00
|
|
|
#include "shader.hpp"
|
|
|
|
|
|
|
|
namespace renderer{
|
2023-05-20 21:19:44 +02:00
|
|
|
typedef oneapi::tbb::concurrent_unordered_set<Chunk::Chunk*> RenderSet;
|
|
|
|
|
2023-09-17 10:40:55 +02:00
|
|
|
void init(GLFWwindow* window);
|
2023-09-17 15:48:11 +02:00
|
|
|
void render();
|
|
|
|
void resize_framebuffer(int width, int height);
|
2023-09-17 10:40:55 +02:00
|
|
|
void framebuffer_size_callback(GLFWwindow *window, int width, int height);
|
2023-04-09 21:44:17 +02:00
|
|
|
void destroy();
|
2023-09-17 15:48:11 +02:00
|
|
|
|
2023-09-17 15:50:25 +02:00
|
|
|
void saveScreenshot(bool forceFullHD=false);
|
|
|
|
|
2023-04-09 21:44:17 +02:00
|
|
|
Shader* getRenderShader();
|
2023-05-20 21:19:44 +02:00
|
|
|
RenderSet& getChunksToRender();
|
2023-10-04 12:10:33 +02:00
|
|
|
ChunkMeshDataQueue& getMeshDataQueue();
|
2023-04-09 21:44:17 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2023-10-04 12:10:33 +02:00
|
|
|
|