update DrawContext

This commit is contained in:
MihailRis
2024-07-21 16:06:40 +03:00
parent cf12338a32
commit 3590bd14cd
9 changed files with 67 additions and 45 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ void LineBatch::line(
float r, float g, float b, float a
) {
if (index + LB_VERTEX_SIZE * 2 >= capacity) {
render();
flush();
}
buffer[index] = x1;
buffer[index+1] = y1;
@@ -65,7 +65,7 @@ void LineBatch::box(float x, float y, float z, float w, float h, float d,
line(x+w, y+h, z-d, x+w, y+h, z+d, r,g,b,a);
}
void LineBatch::render(){
void LineBatch::flush(){
if (index == 0)
return;
mesh->reload(buffer.get(), index / LB_VERTEX_SIZE);