diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-11-13 10:55:38 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-11-13 10:55:38 -0500 |
| commit | 8f13501beaad34d4d58178ab7a41747c28cf6faa (patch) | |
| tree | 73b8cfbb5cf7e2d641d6072a0865b06f57c0a917 | |
| parent | 0d578ef5b2b0befb3788b8f8405d1713b3e7ee13 (diff) | |
| download | balls-8f13501beaad34d4d58178ab7a41747c28cf6faa.zip | |
move genVertices() out of display()
| -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); |