当顶点和顶点索引为空时不绘制
This commit is contained in:
parent
f73e7e4a50
commit
5220ba6e39
@ -133,11 +133,11 @@ void dx_window::begin_frame() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
context.draw_rectangle({ pos_x, pos_y }, { 1, 100 }, random_color);
|
context.draw_rectangle({ pos_x, pos_y }, { 1, 100 }, random_color);
|
||||||
pos_x += 1;
|
|
||||||
if (pos_x >= 1000) {
|
if (pos_x >= 1000) {
|
||||||
pos_x = 0;
|
pos_x = 0;
|
||||||
draw_test = false;
|
draw_test = false;
|
||||||
}
|
}
|
||||||
|
pos_x += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ public:
|
|||||||
return triangles;
|
return triangles;
|
||||||
}
|
}
|
||||||
void flush() {
|
void flush() {
|
||||||
|
if (vertices.empty() || triangles.empty()) return;
|
||||||
if (default_pipeline) {
|
if (default_pipeline) {
|
||||||
default_pipeline->set_triangle(vertices, triangles);
|
default_pipeline->set_triangle(vertices, triangles);
|
||||||
default_pipeline->draw();
|
default_pipeline->draw();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user