Skip to content

openmodelviewer/libopenmodelviewer

Repository files navigation

libopenmodelviewer

status License language Build Coverage

libopenmodelviewer is a lightweight, modular 3D rendering library written in modern C++20. It is designed to be embedded into native GUI applications as a rendering toolkit, not as a real-time interactive engine. The library handles model loading, scene rendering, and rendering context setup (OpenGL, Vulkan, DirectX) internally, exposing a clean API to external frontends.

Its main goal is to provide a minimal and reusable rendering layer, fully decoupled from any GUI logic.

🚧 Status

Note: This project is under active development.
The current codebase is not stable and APIs may change. Documentation and public examples will follow in future versions.

🔧 Getting Started

Requirements

  • C++20 compiler (MSVC, Clang, or GCC 11+)
  • CMake ≥ 3.16
  • fmt (required)
  • GoogleTest (optional, for unit tests)
  • Doxygen (optional, for documentation generation)
  • Graphviz (optional, include diagrams in documentation)

🛠 Build

This project includes a helper script under the scripts/ directory to simplify the build process.

Build one or more modules

You can build a specific module using:

sh scripts/build.sh core

This builds the core module only.

To build multiple modules at once:

sh scripts/build.sh core renderer

This compiles both core and renderer.


Manually build tests

To build the tests associated with each module, add tests to the module list:

sh scripts/build.sh core renderer tests

This compiles both core and renderer modules, as well as their corresponding test targets (core_test, renderer_test), allowing you to run ctest manually (e.g. in a CI pipeline).


Automatically run tests after build

To automatically run the tests after building, add the -test flag after the module list:

sh scripts/build.sh core -test

This will:

  1. Build the core module and its tests
  2. Run all tests using ctest in the corresponding build directory

You can also combine multiple modules with -test:

sh scripts/build.sh core renderer -test

This builds both modules and runs all their associated tests.

ℹ️ The script runs ctest automatically for each compiled module when -test is used.

Build documentation

To generate the API documentation using Doxygen, simply add docs to the list of modules:

sh scripts/build.sh core renderer docs

This will build the core and renderer modules, and also generate the documentation into:

build/docs/html/index.html

You can open this file in your browser to browse the full API reference.

ℹ️ Ensure that Doxygen and Graphviz are installed on your system to include diagrams such as inheritance trees and include graphs.

Languages