mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
refactor: extract DebugLinesRenderer
This commit is contained in:
parent
a78931205f
commit
3aac6ecbcb
5 changed files with 104 additions and 97 deletions
39
src/graphics/render/DebugLinesRenderer.hpp
Normal file
39
src/graphics/render/DebugLinesRenderer.hpp
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#pragma once
|
||||
|
||||
class DrawContext;
|
||||
class Camera;
|
||||
class LineBatch;
|
||||
class LinesRenderer;
|
||||
class Shader;
|
||||
class Level;
|
||||
|
||||
class DebugLinesRenderer {
|
||||
public:
|
||||
DebugLinesRenderer(const Level& level)
|
||||
: level(level) {};
|
||||
|
||||
/// @brief Render debug lines in the world
|
||||
/// @param ctx Draw context
|
||||
/// @param camera Camera used for rendering
|
||||
/// @param renderer Lines renderer used for rendering lines
|
||||
/// @param linesShader Shader used for rendering lines
|
||||
/// @param showChunkBorders Whether to show chunk borders
|
||||
void render(
|
||||
DrawContext& ctx,
|
||||
const Camera& camera,
|
||||
LinesRenderer& renderer,
|
||||
LineBatch& linesBatch,
|
||||
Shader& linesShader,
|
||||
bool showChunkBorders
|
||||
);
|
||||
private:
|
||||
const Level& level;
|
||||
|
||||
void drawBorders(
|
||||
LineBatch& batch, int sx, int sy, int sz, int ex, int ey, int ez
|
||||
);
|
||||
void drawCoordSystem(
|
||||
LineBatch& batch, const DrawContext& pctx, float length
|
||||
);
|
||||
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue