Lightweight C++ library for rendering a virtual globe in your application, with a C API and OpenGL / OpenGL ES (WebGL 2), Direct3D 11 and Ogre 14 backends
翻译准备中
正在加载完整 README。
查看完整 README ↗vgl is a lightweight, open-source C++ library for rendering a virtual globe inside an existing application. It streams level-of-detail terrain and imagery on the WGS84 ellipsoid and draws it through backends for OpenGL / OpenGL ES, Direct3D 11 and Ogre, on Windows, Linux, macOS, Android and iOS, and in web browsers on WebGL 2. The public interface is a C API, so the library embeds as easily in a C code base as in a C++ one.
Status: version 1.0. The C ABI stays compatible within major version 1 (C API conventions, section 14). The Ogre backend covers OpenGL 3+ and Direct3D 11 on Windows and Linux; Ogre on Vulkan, macOS and mobile follows (changelog, Known limitations).
These are out of scope for the first releases, and the architecture is not shaped around them:
Try the live demo in a browser first, or browse the project site and its API reference. The integrator's guide covers each step in detail, starting with Getting started.
1. Get vgl. Download a release archive from
GitHub releases and point CMAKE_PREFIX_PATH at it,
use the vcpkg port or the Conan recipe (packaging), or build from source
(below).
2. See it run. Build with a workflow preset and start the OpenGL sample on the sample data:
cmake --workflow --preset linux-gcc-static-release # or windows-msvc-static-release, macos-clang-static-release
build/linux-gcc-static/bin/Release/vgl-gl
3. Link it.
find_package(vgl 1 REQUIRED)
target_link_libraries(my_app PRIVATE vgl::vgl vgl::defaults vgl::gl)
4. Draw a globe. Your application keeps its window, loop and camera:
vgl_thread_pool_create, vgl_file_reader_create)
and pass their task and I/O interfaces to vgl_context_create.vgl_pack_create: elevation, the geoid and imagery, such as those in
samples/data/packs. Bake your own with vgl-bake (baker) and
serve them from disk or any web server (hosting).vgl_gl_backend_create with your OpenGL
function loader.vgl_context_view_set with your camera, vgl_context_update, then the
backend's draw (vgl_gl_backend_draw) inside your render pass. Show the lines of
vgl_context_attribution_get while their data is in view.vgl uses CMake 3.24 or later and a C++20 compiler.
cmake -S . -B build
cmake --build build
ctest --test-dir build
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗