mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
add in-world lines renderer
This commit is contained in:
parent
e0123f85ea
commit
70c5c67bd1
4 changed files with 44 additions and 0 deletions
14
src/graphics/render/LinesRenderer.cpp
Normal file
14
src/graphics/render/LinesRenderer.cpp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#include "LinesRenderer.hpp"
|
||||
|
||||
#include "graphics/core/LineBatch.hpp"
|
||||
|
||||
void LinesRenderer::draw(LineBatch& batch) {
|
||||
for (const auto& line : queue) {
|
||||
batch.line(line.a, line.b, line.color);
|
||||
}
|
||||
queue.clear();
|
||||
}
|
||||
|
||||
void LinesRenderer::pushLine(const glm::vec3& a, const glm::vec3& b, const glm::vec4& color) {
|
||||
queue.push_back({a, b, color});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue