How jonaslindemann/ivf2 works
Project Type and Purpose
• This is a C++ cross-platform library (Ivf++ 2) providing a modern OpenGL wrapper built around a scene graph.
• It also includes several sub-libraries for mesh generation (generator), math utilities (ivfmath), UI integration (ivfui), and the OpenGL loader (glad), plus a unified CMake target (ivf2::ivf2).
• A set of example applications demonstrate use-cases: animation, lighting, physics, UI, procedural geometry.
High-Level Components
a. Build System & Package Manager
• CMake + vcpkg detection → orchestrates builds of all subprojects and examples.
b. Core Libraries
• glad – OpenGL loader
• ivf – core scene graph, node hierarchy, resource managers (textures, shaders, meshes), post-processing, lights, cameras
• ivfmath – keyframe data/interpolator, vector/sphere/spline math utilities
• ivfui – UI layer on top of ivf and ImGui, window management, inspectors, controls
c. Unified Export
• ivf2::ivf2 target aggregates all above libs and external dependencies (GLM, GLFW, ImGui, ReactPhysics3D, etc.)
d. Examples & Assets
• Executables (under examples/) link against ivf2::ivf2
• Asset folders (bin/shaders, bin/fonts, bin/assets) auto-copied at build time
e. External Services/Dependencies
• vcpkg-managed libraries (GLFW, ImGui, Boost, etc.)
• GPU / OpenGL driver
Interactions and Data Flows
• Examples → Link → ivf2::ivf2 → calls into sub-libraries
• ivf calls into glad to issue OpenGL calls to the GPU
• ivf uses ivfmath for interpolation and advanced math
• ivfui uses ivf to render UI controls and scene overlays
• generator is either used standalone or by ivf for procedural meshes
• Build System coordinates CMake targets and copies assets into example output directories
Architectural Patterns & Principles
• Layered Architecture
• Bootstrapping & build configuration at the bottom
• Loader (glad) → Math (ivfmath) & Generator (generator) → Core Scene Graph (ivf) → UI (ivfui) → Examples
• Modular Design
• Each library is its own CMake target with public include directories and private implementation
• Unified CMake alias target hides individual dependencies
• Dependency Inversion
• Examples depend on abstract interface (ivf2::ivf2), not on individual libraries
• Automatic Resource Management
• CMake helper add_ivf2_example for copying assets and linking dependencies