General refactor

This commit is contained in:
MihailRis
2023-11-30 04:30:40 +03:00
parent de134dc2e5
commit 1d5037893c
27 changed files with 558 additions and 419 deletions
+46
View File
@@ -0,0 +1,46 @@
#ifndef WORLD_RENDERER_CPP
#define WORLD_RENDERER_CPP
#include <vector>
#include <algorithm>
#include <GL/glew.h>
#include <string>
#include <glm/glm.hpp>
#include <glm/ext.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include "../graphics/GfxContext.h"
class Level;
class Camera;
class LineBatch;
class ChunksRenderer;
class Shader;
class Texture;
class Frustum;
class Engine;
class Chunks;
class ContentGfxCache;
class Skybox;
class WorldRenderer {
Engine* engine;
Level* level;
Frustum* frustumCulling;
LineBatch* lineBatch;
ChunksRenderer* renderer;
Skybox* skybox;
bool drawChunk(size_t index, Camera* camera, Shader* shader, bool culling);
void drawChunks(Chunks* chunks, Camera* camera, Shader* shader);
public:
WorldRenderer(Engine* engine, Level* level, const ContentGfxCache* cache);
~WorldRenderer();
void draw(const GfxContext& context, Camera* camera);
void drawDebug(const GfxContext& context, Camera* camera);
void drawBorders(int sx, int sy, int sz, int ex, int ey, int ez);
};
#endif // WORLD_RENDERER_CPP