How loupi233rb/boids works
Boids is a C++ OpenGL flocking simulation. The visible entry point initializes the application, polls window events, and starts separate timing, rendering, and AI threads; it then stops and joins them and deletes the birds. The README identifies the product and notes high CPU usage. The main source is sampled, but the simulation, rendering, input, and settings implementations are not, so their internal call paths and data flow cannot be established here.
Main entry points: main.cpp Application entry · glfw3.h GLFW windowing · render.cpp Render loop · render.h OpenGL renderer
Components 17
Application lifecycle
- Application entry
src/main.cpp - Initial settings
src/info.cpp - Thread control
include/funcThread.h
Simulation runtime
- Simulation timing
src/timer.cpp - Flock AI
src/bird.cpp - Bird model
include/bird.h - Bird collection
include/info.h
Window and rendering
- Render loop
src/render.cpp - OpenGL renderer
include/render.h - Shader support
include/shader.h
Input and state
- Keyboard input
src/key.cpp - Keyboard declarations
include/key.h - Mouse input
src/mouse.cpp - Mouse declarations
include/mouse.h
Other components
- User
- GLFW windowing
external/glfw-3.4/include/GLFW/glfw3.h - OpenGL API
external/glad/include/glad/gl.h
Connections 12
- User → GLFW windowing: provides events
- Application entry → Initial settings: initializes
- Application entry → Thread control: starts and stops
- Application entry → Simulation timing: starts tick
- Application entry → Render loop: starts rendering
- Application entry → Flock AI: starts AI
- Application entry → GLFW windowing: polls events
- Application entry → Bird collection: deletes birds
- Keyboard input → GLFW windowing: reads keys
- Mouse input → GLFW windowing: reads pointer
- Render loop → OpenGL renderer: renders
- OpenGL renderer → OpenGL API: draws with