From eef1190e6a8e296e5ac4f19e44078006c82f97b8 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Sat, 26 Oct 2024 19:41:57 -0400 Subject: display() --- balls.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'balls.c') diff --git a/balls.c b/balls.c index a097c82..c4f4e2a 100644 --- a/balls.c +++ b/balls.c @@ -316,8 +316,17 @@ compileShader(GLint shader) { void display(void) { - /* TODO */ - sysfatal("display() not implemented.\n"); + int i; + + glClear(GL_COLOR_BUFFER_BIT |GL_DEPTH_BUFFER_BIT); + + for (i = nelem(vao)-1; i >= 0; i--) { + glBindVertexArray(vao[i]); + glDrawArrays(GL_TRIANGLE_FAN, 0, 4); + } + + glBindVertexArray(0); + glutSwapBuffers(); } void -- cgit v1.2.3