diff options
| -rw-r--r-- | balls.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -545,7 +545,8 @@ animate(int v) { collideBalls(); cpuEvent = collideWalls(); - /* Disply current from with GPU. */ + /* Display current frame with GPU. */ + genVertices(); display(); /* Copy next frame's positions from CPU to GPU. */ @@ -563,8 +564,6 @@ display(void) { glClear(GL_COLOR_BUFFER_BIT |GL_DEPTH_BUFFER_BIT); - genVertices(); - glBindVertexArray(vertexVAO); for (i = 0; i < nBalls; i++) glDrawArrays(GL_TRIANGLE_FAN, i*CIRCLE_POINTS, CIRCLE_POINTS); |