summaryrefslogtreecommitdiffstats
path: root/balls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'balls.cpp')
-rw-r--r--balls.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/balls.cpp b/balls.cpp
index dfcf8d8..b98b322 100644
--- a/balls.cpp
+++ b/balls.cpp
@@ -210,9 +210,9 @@ animate(int v) {
});
}
- /* TODO: parallel */
- for (Ball *ball : balls)
- collideWall(ball, bounds);
+ parallel_for(size_t(0), balls.size(), [] (size_t i) {
+ collideWall(balls[i], bounds);
+ });
display();
glutTimerFunc(FRAME_TIME_MS, animate, 0);