Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Language: Cpp
Standard: c++20
BasedOnStyle: Google
ColumnLimit: 100
UseTab: ForContinuationAndIndentation
IndentWidth: 4
TabWidth: 4
IndentCaseLabels: true
LambdaBodyIndentation: OuterScope
IndentPPDirectives: AfterHash
AlwaysBreakTemplateDeclarations: Yes

IndentRequiresClause: false
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope

DerivePointerAlignment: false
AllowShortCaseLabelsOnASingleLine: true
QualifierAlignment: Left
AlignConsecutiveShortCaseStatements:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
AlignCaseColons: false
8 changes: 2 additions & 6 deletions .github/workflows/ci_x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ env:

jobs:
build_windows:
strategy:
matrix:
cpp20: [NO, YES]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -37,7 +34,7 @@ jobs:
run: git clone https://github.com/KhronosGroup/glTF-Sample-Assets ${{ github.workspace }}/${{ env.SAMPLE_ASSETS_LOCATION }}

- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DFASTGLTF_ENABLE_TESTS=ON -DFASTGLTF_COMPILE_AS_CPP20=${{ matrix.cpp20 }}
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DFASTGLTF_ENABLE_TESTS=ON

- name: Build (Windows)
run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} --target tests/fastgltf_tests --verbose
Expand Down Expand Up @@ -86,7 +83,6 @@ jobs:
matrix:
c_compiler: [gcc-12, gcc-13, gcc-14, clang-16, clang-17, clang-18]
os: [ubuntu-24.04]
cpp20: [NO, YES]
include:
- cxx_compiler: g++-12
c_compiler: gcc-12
Expand Down Expand Up @@ -120,7 +116,7 @@ jobs:
run: git clone https://github.com/KhronosGroup/glTF-Sample-Assets ${{ github.workspace }}/${{ env.SAMPLE_ASSETS_LOCATION }}

- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DFASTGLTF_ENABLE_TESTS=ON -DFASTGLTF_COMPILE_AS_CPP20=${{ matrix.cpp20 }}
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DFASTGLTF_ENABLE_TESTS=ON

- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} --target fastgltf_tests --verbose
Expand Down
7 changes: 1 addition & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,12 @@ option(FASTGLTF_ENABLE_ASSIMP "Enables the benchmark usage of assimp" OFF)
option(FASTGLTF_ENABLE_DEPRECATED_EXT "Enables support for deprecated extensions" OFF)
option(FASTGLTF_DISABLE_CUSTOM_MEMORY_POOL "Disables the memory allocation algorithm based on polymorphic resources" OFF)
option(FASTGLTF_USE_64BIT_FLOAT "Default to 64-bit double precision floats for everything" OFF)
option(FASTGLTF_COMPILE_AS_CPP20 "Have the library compile as C++20" OFF)
option(FASTGLTF_ENABLE_CPP_MODULES "Enables the fastgltf::module target, which uses C++20 modules" OFF)
option(FASTGLTF_USE_STD_MODULE "Use the std module when compiling using C++ modules" OFF)
option(FASTGLTF_ENABLE_KHR_IMPLICIT_SHAPES "Enable support for the experimental KHR_implicit_shapes extension" OFF)
option(FASTGLTF_ENABLE_KHR_PHYSICS_RIGID_BODIES "Enable support for the experimental KHR_physics_rigid_bodies extension" OFF)

if (FASTGLTF_COMPILE_AS_CPP20)
set(FASTGLTF_COMPILE_TARGET cxx_std_20)
else ()
set(FASTGLTF_COMPILE_TARGET cxx_std_17)
endif ()
set(FASTGLTF_COMPILE_TARGET cxx_std_20)

# physics rigid bodies depends on implicit shapes
if (FASTGLTF_ENABLE_KHR_PHYSICS_RIGID_BODIES)
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
[![Documentation Status](https://readthedocs.org/projects/fastgltf/badge/?version=latest)](https://fastgltf.readthedocs.io/latest/?badge=latest)


**fastgltf** is a speed and usability focused glTF 2.0 library written in modern C++17 with minimal dependencies.
**fastgltf** is a speed and usability focused glTF 2.0 library written in modern C++20 with minimal dependencies.
It uses SIMD in various areas to decrease the time the application spends parsing and loading glTF data.
By taking advantage of modern C++17 (and optionally C++20) it also provides easy and safe access to the properties and data.
By taking advantage of modern C++20 it also provides easy and safe access to the properties and data.
It is also available as a C++20 [named module](https://en.cppreference.com/w/cpp/language/modules).

The library supports the entirety of glTF 2.0 specification, including many extensions.
Expand All @@ -19,6 +19,9 @@ including accessor tools, the ability to directly write to mapped GPU buffers, a

To learn more about fastgltf, its features, performance and API you can read [the docs](https://fastgltf.readthedocs.io/).

> [!NOTE]
> For C++17 compatibility, please use v0.9.x. Later versions require C++20.

## Examples and real-world usage

You can find some examples in the `examples/` directory of this repository on how to use fastgltf in a 3D renderer to load glTF files.
Expand Down
7 changes: 5 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
fastgltf
========

**fastgltf** is a speed and usability focused glTF 2.0 library written in modern C++17 with minimal dependencies.
**fastgltf** is a speed and usability focused glTF 2.0 library written in modern C++20 with minimal dependencies.
It uses SIMD in various areas to decrease the time the application spends parsing and loading glTF data.
By taking advantage of modern C++17 (and optionally C++20) it also provides easy and safe access to the properties and data.
By taking advantage of modern C++20 it also provides easy and safe access to the properties and data.
It is also available as a C++20 `named module <https://en.cppreference.com/w/cpp/language/modules>`_.

The library supports the entirety of glTF 2.0 specification, including many extensions.
By default, fastgltf will only do the absolute minimum to work with a glTF model.
However, it brings many additional features to ease working with the data,
including accessor tools, the ability to directly write to mapped GPU buffers, and decomposing transform matrices.

.. note::
For C++17 compatibility, please use v0.9.x. Later versions require C++20.

Indices and tables
------------------
Expand Down
7 changes: 0 additions & 7 deletions docs/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ This allocator allocates fixed-size blocks of memory as needed and divides them
All of this functionality can be disabled using this flag.
All types will then be normal ``std`` containers and use standard heap allocation with new and malloc.

``FASTGLTF_COMPILE_AS_CPP20``
-----------------------------

This ``BOOL`` option controls the C++ standard the library is compiled as. When ``NO`` fastgltf is always compiled as C++17.
When ``YES`` fastgltf is compiled as C++20, including the tests. This might allow the compiler to perform certain optimisations,
since fastgltf then uses some specialized stdlib functions instead.

``FASTGLTF_ENABLE_CPP_MODULES``
-------------------------------

Expand Down
8 changes: 5 additions & 3 deletions docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ Overview

.. contents:: Table of Contents

**fastgltf** is a speed and usability focused glTF 2.0 library written in modern C++17 with minimal dependencies.
**fastgltf** is a speed and usability focused glTF 2.0 library written in modern C++20 with minimal dependencies.
It uses SIMD in various areas to decrease the time the application spends parsing and loading glTF data.
By taking advantage of modern C++17 (and optionally C++20) it also provides easy and safe access to the properties and data.
By taking advantage of modern C++20 it also provides easy and safe access to the properties and data.
It is also available as a C++20 `named module <https://en.cppreference.com/w/cpp/language/modules>`_.

The library supports the entirety of glTF 2.0 specification, including many extensions.
By default, **fastgltf** will only do the absolute minimum to work with a glTF model.
However, it brings many additional features to ease working with the data,
including accessor tools, the ability to directly write to mapped GPU buffers, and decomposing transform matrices.

.. note::
For C++17 compatibility, please use v0.9.x. Later versions require C++20.

.. _why:

Expand Down Expand Up @@ -110,7 +112,7 @@ Usage
.. _vcpkg: https://github.com/microsoft/vcpkg
.. _conan: https://conan.io/

**fastgltf** is a pure C++17 library and only depends on simdjson.
**fastgltf** is a C++20 library and only depends on simdjson.
By using the included CMake 3.11 script, simdjson is automatically downloaded while configuring by default.
The library is tested on GCC 9, GCC 10, Clang 13, and MSVC 14 (Visual Studio 2022) using CI.
**fastgltf** is also available from vcpkg_ and conan_.
Expand Down
Loading
Loading