当顶点和顶点索引为空时不绘制
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);
|
||||
pos_x += 1;
|
||||
if (pos_x >= 1000) {
|
||||
pos_x = 0;
|
||||
draw_test = false;
|
||||
}
|
||||
pos_x += 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,6 +47,7 @@ public:
|
||||
return triangles;
|
||||
}
|
||||
void flush() {
|
||||
if (vertices.empty() || triangles.empty()) return;
|
||||
if (default_pipeline) {
|
||||
default_pipeline->set_triangle(vertices, triangles);
|
||||
default_pipeline->draw();
|
||||
|
Loading…
x
Reference in New Issue
Block a user