diff options
Diffstat (limited to 'util/sokol_gl.h')
| -rw-r--r-- | util/sokol_gl.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util/sokol_gl.h b/util/sokol_gl.h index 2a306c4b..6b3e1cbf 100644 --- a/util/sokol_gl.h +++ b/util/sokol_gl.h @@ -2030,10 +2030,8 @@ SOKOL_API_IMPL void sgl_begin_quads(void) { SOKOL_API_IMPL void sgl_end(void) { SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); SOKOL_ASSERT(_sgl.in_begin); + SOKOL_ASSERT(_sgl.cur_vertex >= _sgl.base_vertex); _sgl.in_begin = false; - if (_sgl.base_vertex == _sgl.cur_vertex) { - return; - } bool matrix_dirty = _sgl.matrix_dirty; if (matrix_dirty) { _sgl.matrix_dirty = false; @@ -2360,7 +2358,9 @@ SOKOL_API_IMPL void sgl_draw(void) { cur_uniform_index = args->uniform_index; } /* FIXME: what if number of vertices doesn't match the primitive type? */ - sg_draw(args->base_vertex, args->num_vertices, 1); + if (args->num_vertices > 0) { + sg_draw(args->base_vertex, args->num_vertices, 1); + } } break; } |