{"repo":"skypjack/entt","free":true,"listed":false,"github":"https://github.com/skypjack/entt","clone":"git clone https://github.com/skypjack/entt.git","description":"Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more","language":"C++","stars":13020,"topics":["architectural-patterns","cpp","cpp17","cpp20","data-oriented","data-oriented-design","ecs","ecs-framework","entity-component-system","entt","game-dev","game-development","game-engine","game-programming","gamedev","header-only","modern-cpp","no-dependencies","production-ready","reflection"],"license":"MIT","category":"game_engine_core","readme_excerpt":"![EnTT: Gaming meets modern C++](https://user-images.githubusercontent.com/1812216/103550016-90752280-4ea8-11eb-8667-12ed2219e137.png)\n\n[![Build Status](https://github.com/skypjack/entt/workflows/build/badge.svg)](https://github.com/skypjack/entt/actions)\n[![Coverage](https://codecov.io/gh/skypjack/entt/branch/master/graph/badge.svg)](https://codecov.io/gh/skypjack/entt)\n[![Try online](https://img.shields.io/badge/try-online-brightgreen)](https://godbolt.org/z/zxW73f)\n[![Documentation](https://img.shields.io/badge/docs-doxygen-blue)](https://skypjack.github.io/entt/)\n[![Vcpkg port](https://img.shields.io/vcpkg/v/entt)](https://vcpkg.link/ports/entt)\n[![Conan Center](https://img.shields.io/conan/v/entt)](https://conan.io/center/recipes/entt)\n[![Gitter chat](https://badges.gitter.im/skypjack/entt.png)](https://gitter.im/skypjack/entt)\n[![Discord channel](https://img.shields.io/discord/707607951396962417?logo=discord)](https://discord.gg/5BjPWBd)\n\n> `EnTT` has been a dream so far, we haven't found a single bug to date and it's\n> super easy to work with\n>\n> -- Every EnTT User Ever\n\n`EnTT` is a header-only, tiny and easy to use library for game programming and\nmuch more written in **modern C++**.<br/>\n[Among others](https://github.com/skypjack/entt/wiki/EnTT-in-Action), it's used\nin [**Minecraft**](https://minecraft.net/en-us/attribution/) by Mojang, the\n[**ArcGIS Runtime SDKs**](https://developers.arcgis.com/arcgis-runtime/) by Esri\nand the amazing [**Ragdoll**](https://ragdolldynamics.com/).<br/>\nIf you don't see your project in the list, please open an issue, submit a PR or\nadd the [\\#entt](https://github.com/topics/entt) tag to your _topics_! :+1:\n\n---\n\nDo you want to **keep up with changes** or do you have a **question** that\ndoesn't require you to open an issue?<br/>\nJoin the [gitter channel](https://gitter.im/skypjack/entt) and the\n[discord server](https://discord.gg/5BjPWBd), meet other users like you. The\nmore we are, the better for everyone.<br/>\nDon't forget to check the\n[FAQs](https://github.com/skypjack/entt/wiki/Frequently-Asked-Questions) and the\n[wiki](https://github.com/skypjack/entt/wiki) too. Your answers may already be\nthere.\n\nDo you want to support `EnTT`? Consider becoming a\n[**sponsor**](https://github.com/users/skypjack/sponsorship) or making a\ndonation via [**PayPal**](https://www.paypal.me/skypjack).<br/>\nMany thanks to [these people](https://skypjack.github.io/sponsorship/) and\n**special** thanks to:\n\n[![mojang](https://user-images.githubusercontent.com/1812216/106253145-67ca1980-6217-11eb-9c0b-d93561b37098.png)](https://mojang.com)\n[![imgly](https://user-images.githubusercontent.com/1812216/106253726-271ed000-6218-11eb-98e0-c9c681925770.png)](https://img.ly/)\n\n# Table of Contents\n\n* [Introduction](#introduction)\n  * [Code Example](#code-example)\n  * [Motivation](#motivation)\n  * [Benchmark](#benchmark)\n* [Integration](#integration)\n  * [Requirements](#requirements)\n  * [CMake](#cmake)\n  * [Natvis support](#natvis-support)\n  * [Packaging Tools](#packaging-tools)\n  * [pkg-config](#pkg-config)\n* [Documentation](#documentation)\n* [Tests](#tests)\n* [EnTT in Action](#entt-in-action)\n* [Contributors](#contributors)\n* [License](#license)\n\n# Introduction\n\nThe entity-component-system (also known as _ECS_) is an architectural pattern\nused mostly in game development. For further details:\n\n* [Entity Systems Wiki](http://entity-systems.wikidot.com/)\n* [Evolve Your Hierarchy](http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/)\n* [ECS on Wikipedia](https://en.wikipedia.org/wiki/Entity%E2%80%93component%E2%80%93system)\n\nThis project started off as a pure entity-component system. Over time the\ncodebase has grown as more and more classes and functionalities were added.<br/>\nHere is a brief, yet incomplete list of what it offers today:\n\n* Built-in **RTTI system** mostly similar to the standard one.\n* A `constexpr` utility for human-readable **resource names**.\n* Minimal **configuration system** built using the monostate pattern.\n* Incredibly fast **entity-component system** with its own _pay for what you\n  use_ policy, unconstrained component types with optional pointer stability and\n  hooks for storage customization.\n* Views and groups to iterate entities and components and allow different access\n  patterns, from **perfect SoA** to fully random.\n* A lot of **facilities** built on top of the entity-component system to help\n  the users and avoid reinventing the wheel.\n* General purpose **execution graph builder** for optimal scheduling.\n* The smallest and most basic implementation of a **service locator** ever seen.\n* A built-in, non-intrusive and macro-free runtime **reflection system**.\n* **Static polymorphism** made simple and within everyone's reach.\n* A few homemade containers, like a sparse set based **hash map**.\n* A **cooperative scheduler** for processes of any type.\n* All that is needed for **resource management** (cache, loaders, handles).\n* Delegates, **signal handlers** and a tiny event dispatcher.\n* A general purpose **event emitter** as a CRTP idiom based class template.\n* And **much more**! Check out the\n  [**wiki**](https://github.com/skypjack/entt/wiki).\n\nConsider this list a work in progress as well as the project. The whole API is\nfully documented in-code for those who are brave enough to read it.<br/>\nPlease, do note that all tools are also DLL-friendly now and run smoothly across\nboundaries.\n\nOne thing known to most is that `EnTT` is also used in **Minecraft**.<br/>\nGiven that the game is available literally everywhere, I can confidently say \nthat the library has been sufficiently tested on every platform that can come to \nmind.\n\n## Code Example\n\n```cpp\n#include <entt/entt.hpp>\n\nstruct position {\n    float x;\n    float y;\n};\n\nstruct velocity {\n    float dx;\n    float dy;\n};\n\nvoid update(entt::registry &registry) {\n    auto view = registry.view<const position, velocity>();\n\n    // use a callback\n    view.each([](const auto &pos, auto &vel) { /* ... */ });\n\n    // use an extended callback\n    view.each([](const auto entity, const auto &pos, auto &vel) { /* ... */ });\n\n    // use a range-for\n    for(auto [entity, pos, vel]: view.each()) {\n        // ...\n    }\n\n    // use forward iterators and get only the components of interest\n    for(auto entity: view) {\n        auto &vel = view.get<velocity>(entity);\n        // ...\n    }\n}\n\nint main() {\n    entt::registry registry;\n\n    for(auto i = 0u; i < 10u; ++i) {\n        const auto entity = registry.create();\n        registry.emplace<position>(entity, i * 1.f, i * 1.f);\n        if(i % 2 == 0) { registry.emplace<velocity>(entity, i * .1f, i * .1f); }\n    }\n\n    update(registry);\n}\n```\n\n## Motivation\n\nI started developing `EnTT` for the _wrong_ reason: my goal was to design an\nentity-component system to beat another well known open source library both in\nterms of performance and possibly memory usage.<br/>\nIn the end, I did it, but it wasn't very satisfying. Actually it wasn't\nsatisfying at all. The fastest and nothing more, fairly little indeed. When I\nrealized it, I tried hard to keep intact the great performance of `EnTT` and to\nadd all the features I wanted to see in *my own library* at the same time.\n\nNowadays, `EnTT` is finally what I was looking for: still faster than its\n_competitors_, lower memory usage in the average case, a really good API and an\namazing set of features. And even more, of course.\n\n## Benchmark\n\nFor what it's worth, you'll **never** see me trying to make other projects look\nbad or offer dubious comparisons just to make this library seem cooler.<br/>\nI leave this activity to others, if they enjoy it (and it seems that some people\nactually like it). I prefer to make better use of my time.\n\nIf you are interested, you can compile the `benchmark` test in release mode (to\nenable compiler optimizations, otherwise it would make little sense) by setting\nthe `ENTT_BUILD_BENCHMARK` option of `CMake` to `ON`, then evaluate yourself\nwhether you're satisfied with the results or not.\n\nThere are also a lot of projects out there that use `EnTT` as a basis for\ncomparison (this should already tell you a lot). Many of these benchmarks are\ncompletely wrong, many others are simply incomplete, good at omitting some\ninformation and using the wrong function to compare a given feature. Certainly\nthere are also good ones but they age quickly if nobody updates them, especially\nwhen the library they are dealing with is actively developed.<br/>\nOut of all of them, [this](https://github.com/abeimler/ecs_benchmark) seems like\nthe most up-to-date project and also covers a certain number of libraries. I\ncan't say exactly whether `EnTT` is used correctly or not. However, even if used\npoorly, it should still give the reader an idea of where it's going to operate.\n\n# Integration\n\n`EnTT` is a header-only library. This means that including the `entt.hpp` header\nis enough to include the library as a whole and use it. For those who are\ninterested only in the entity-component system, consider to include the sole\n`entity/registry.hpp` header instead.<br/>\nIt's a matter of adding the following line to the top of a file:\n\n```cpp\n#include <entt/entt.hpp>\n```\n\nUse the line below to include only the entity-component system instead:\n\n```cpp\n#include <entt/entity/registry.hpp>\n```\n\nThen pass the proper `-I` argument to the compiler to add the `src` directory to\nthe include paths.\n\n## Requirements\n\nTo be able to use `EnTT`, users must provide a full-featured compiler that\nsupports at least C++20.<br/>\nThe requirements below are mandatory to compile the tests and to extract the\ndocumentation:\n\n* `CMake` version 3.28 or later.\n* `Doxygen` version 1.14 or later.\n\nAlternatively, [Bazel](https://bazel.build) is also supported as a build system\n(credits to [zaucy](https://github.com/zaucy) who offered to maintain it).<br/>\nIn the documentation below I'll still refer to `CMake`, this being the official\nbuild system of the library.\n\n## CMake\n\nTo use `EnTT` from a `CMak","default_branch":"main","files":374,"tree":[".bazelignore",".bazeliskrc",".bazelrc",".clang-format",".clang-tidy",".github/FUNDING.yml",".github/workflows/analyzer.yml",".github/workflows/bazel-release-archive.yml",".github/workflows/bazel.yml",".github/workflows/build.yml",".github/workflows/coverage.yml",".github/workflows/deploy.yml",".github/workflows/sanitizer.yml",".github/workflows/testbed.yml",".gitignore","AUTHORS","BUILD.bazel","CMakeLists.txt","CONTRIBUTING.md","LICENSE","MODULE.bazel","README.md","TODO","WORKSPACE.bazel","bazel/BUILD.bazel","bazel/copts.bzl","build/.gitignore","cmake/in/EnTTConfig.cmake.in","cmake/in/entt.pc.in","cmake/modules/JoinPaths.cmake","conan/build.py","conan/ci/build.sh","conan/ci/install.sh","conan/test_package/CMakeLists.txt","conan/test_package/conanfile.py","conan/test_package/test_package.cpp","conanfile.py","docs/CMakeLists.txt","docs/doxy.in","docs/md/config.md","docs/md/container.md","docs/md/core.md","docs/md/entity.md","docs/md/faq.md","docs/md/graph.md","docs/md/lib.md","docs/md/links.md","docs/md/locator.md","docs/md/meta.md","docs/md/poly.md","docs/md/process.md","docs/md/reference.md","docs/md/resource.md","docs/md/signal.md","docs/md/stl.md","entt.imp","scripts/amalgamate.py","scripts/config.json","scripts/sync_bzlmod_version.sh","scripts/update_homebrew.sh","single_include/entt/entt.hpp","src/BUILD.bazel","src/entt/config/config.h","src/entt/config/macro.h","src/entt/config/version.h","src/entt/container/dense_map.hpp","src/entt/container/dense_set.hpp","src/entt/container/fwd.hpp","src/entt/container/table.hpp","src/entt/core/algorithm.hpp","src/entt/core/any.hpp","src/entt/core/bit.hpp","src/entt/core/compressed_pair.hpp","src/entt/core/concepts.hpp","src/entt/core/enum.hpp","src/entt/core/family.hpp","src/entt/core/fwd.hpp","src/entt/core/hashed_string.hpp","src/entt/core/ident.hpp","src/entt/core/iterator.hpp","src/entt/core/memory.hpp","src/entt/core/monostate.hpp","src/entt/core/ranges.hpp","src/entt/core/tuple.hpp","src/entt/core/type_info.hpp","src/entt/core/type_traits.hpp","src/entt/core/utility.hpp","src/entt/entity/component.hpp","src/entt/entity/entity.hpp","src/entt/entity/fwd.hpp","src/entt/entity/group.hpp","src/entt/entity/handle.hpp","src/entt/entity/helper.hpp","src/entt/entity/mixin.hpp","src/entt/entity/organizer.hpp","src/entt/entity/ranges.hpp","src/entt/entity/registry.hpp","src/entt/entity/runtime_view.hpp","src/entt/entity/snapshot.hpp","src/entt/entity/sparse_set.hpp","src/entt/entity/storage.hpp","src/entt/entity/view.hpp","src/entt/entt.hpp","src/entt/fwd.hpp","src/entt/graph/adjacency_matrix.hpp","src/entt/graph/dot.hpp","src/entt/graph/flow.hpp","src/entt/graph/fwd.hpp","src/entt/locator/locator.hpp","src/entt/meta/adl_pointer.hpp","src/entt/meta/container.hpp","src/entt/meta/context.hpp","src/entt/meta/factory.hpp","src/entt/meta/fwd.hpp","src/entt/meta/meta.hpp","src/entt/meta/node.hpp","src/entt/meta/pointer.hpp","src/entt/meta/policy.hpp","src/entt/meta/range.hpp","src/entt/meta/resolve.hpp","src/entt/meta/template.hpp","src/entt/meta/type_traits.hpp","src/entt/meta/utility.hpp","src/entt/natvis/config.natvis","src/entt/natvis/container.natvis","src/entt/natvis/core.natvis","src/entt/natvis/entity.natvis","src/entt/natvis/graph.natvis","src/entt/natvis/locator.natvis","src/entt/natvis/meta.natvis","src/entt/natvis/poly.natvis","src/entt/natvis/process.natvis","src/entt/natvis/resource.natvis","src/entt/natvis/signal.natvis","src/entt/poly/fwd.hpp","src/entt/poly/poly.hpp","src/entt/process/fwd.hpp","src/entt/process/process.hpp","src/entt/process/scheduler.hpp","src/entt/resource/cache.hpp","src/entt/resource/fwd.hpp","src/entt/resource/loader.hpp","src/entt/resource/resource.hpp","src/entt/signal/delegate.hpp","src/entt/signal/dispatcher.hpp","src/entt/signal/emitter.hpp","src/entt/signal/fwd.hpp","src/entt/signal/sigh.hpp","src/entt/stl/algorithm.hpp","src/entt/stl/array.hpp","src/entt/stl/atomic.hpp","src/entt/stl/bit.hpp","src/entt/stl/cmath.hpp","src/entt/stl/concepts.hpp","src/entt/stl/cstddef.hpp","src/entt/stl/cstdint.hpp","src/entt/stl/functional.hpp","src/entt/stl/ios.hpp","src/entt/stl/iterator.hpp","src/entt/stl/limits.hpp","src/entt/stl/memory.hpp","src/entt/stl/ostream.hpp","src/entt/stl/sstream.hpp","src/entt/stl/string.hpp","src/entt/stl/string_view.hpp","src/entt/stl/tuple.hpp","src/entt/stl/type_traits.hpp","src/entt/stl/utility.hpp","src/entt/stl/vector.hpp","src/entt/tools.hpp","src/entt/tools/davey.hpp","test/.bazelrc","test/BUILD.bazel","test/CMakeLists.txt","test/MODULE.bazel","test/WORKSPACE.bazel","test/benchmark/benchmark.cpp","test/common/BUILD.bazel","test/common/basic_test_allocator.hpp","test/common/bitmask.h","test/common/config.h","test/common/emitter.h","test/common/linter.hpp","test/common/listener.h","test/common/meta_traits.h","test/common/mixin.hpp","test/common/registry.h","test/common/throwing_allocator.hpp","test/common/throwing_type.hpp","test/common/tracked_memory_resource.hpp","test/common/transparent_equal_to.h","test/common/value_type.h","test/entt/config/version.cpp","test/entt/config_ext/config.cpp","test/entt/container/dense_map.cpp","test/entt/container/dense_set.cpp","test/entt/container/table.cpp","test/entt/core/algorithm.cpp","test/entt/core/any.cpp","test/entt/core/bit.cpp","test/entt/core/compressed_pair.cpp","test/entt/core/concepts.cpp","test/entt/core/enum.cpp","test/entt/core/family.cpp","test/entt/core/hashed_string.cpp","test/entt/core/ident.cpp","test/entt/core/iterator.cpp","test/entt/core/memory.cpp","test/entt/core/monostate.cpp","test/entt/core/tuple.cpp","test/entt/core/type_info.cpp","test/entt/core/type_traits.cpp","test/entt/core/utility.cpp","test/entt/entity/BUILD.bazel","test/entt/entity/component.cpp","test/entt/entity/entity.cpp","test/entt/entity/group.cpp","test/entt/entity/handle.cpp","test/entt/entity/helper.cpp","test/entt/entity/organizer.cpp","test/entt/entity/reactive_mixin.cpp","test/entt/entity/registry.cpp","test/entt/entity/runtime_view.cpp","test/entt/entity/sigh_mixin.cpp","test/entt/entity/snapshot.cpp","test/entt/entity/sparse_set.cpp","test/entt/entity/storage.cpp","test/entt/entity/storage_entity.cpp","test/entt/entity/storage_no_instance.cpp","test/entt/entity/storage_utility.cpp","test/entt/entity/view.cpp","test/entt/entity_no_mixin/storage_utility.cpp","test/entt/graph/adjacency_matrix.cpp","test/entt/graph/dot.cpp","test/entt/graph/flow.cpp","test/entt/locator/locator.cpp","test/entt/meta/BUILD.bazel","test/entt/meta/meta_any.cpp","test/entt/meta/meta_base.cpp","test/entt/meta/meta_container.cpp","test/entt/meta/meta_context.cpp","test/entt/meta/meta_conv.cpp","test/entt/meta/meta_ctor.cpp","test/entt/meta/meta_custom.cpp","test/entt/meta/meta_data.cpp","test/entt/meta/meta_dereference.cpp","test/entt/meta/meta_factory.cpp","test/entt/meta/meta_func.cpp","test/entt/meta/meta_handle.cpp","test/entt/meta/meta_range.cpp","test/entt/meta/meta_template.cpp","test/entt/meta/meta_type.cpp","test/entt/meta/meta_utility.cpp","test/entt/poly/poly.cpp","test/entt/process/process.cpp","test/entt/process/scheduler.cpp","test/entt/resource/resource.cpp","test/entt/resource/resource_cache.cpp","test/entt/resource/resource_loader.cpp","test/entt/signal/delegate.cpp","test/entt/signal/dispatcher.cpp","test/entt/signal/emitter.cpp","test/entt/signal/sigh.cpp","test/entt/stl/functional.cpp","test/entt/stl/iterator.cpp","test/entt/stl/memory.cpp","test/entt/stl_ext/algorithm.cpp","test/entt/stl_ext/array.cpp","test/entt/stl_ext/atomic.cpp","test/entt/stl_ext/bit.cpp","test/entt/stl_ext/cmath.cpp","test/entt/stl_ext/concepts.cpp","test/entt/stl_ext/cstddef.cpp","test/entt/stl_ext/cstdint.cpp","test/entt/stl_ext/functional.cpp","test/entt/stl_ext/ios.cpp","test/entt/stl_ext/iterator.cpp","test/entt/stl_ext/limits.cpp","test/entt/stl_ext/memory.cpp","test/entt/stl_ext/ostream.cpp","test/entt/stl_ext/sstream.cpp","test/entt/stl_ext/string.cpp","test/entt/stl_ext/string_view.cpp","test/entt/stl_ext/tuple.cpp","test/entt/stl_ext/type_traits.cpp","test/entt/stl_ext/utility.cpp","test/entt/stl_ext/vector.cpp","test/example/custom_identifier.cpp","test/example/entity_copy.cpp","test/example/reserved_bits.cpp","test/example/signal_less.cpp","test/include/entt/ext/config.h","test/include/entt/ext/stl/algorithm.hpp","test/include/entt/ext/stl/array.hpp","test/include/entt/ext/stl/atomic.hpp","test/include/entt/ext/stl/bit.hpp","test/include/entt/ext/stl/cmath.hpp","test/include/entt/ext/stl/concepts.hpp","test/include/entt/ext/stl/cstddef.hpp","test/include/entt/ext/stl/cstdint.hpp","test/include/entt/ext/stl/functional.hpp","test/include/entt/ext/stl/ios.hpp","test/include/entt/ext/stl/iterator.hpp","test/include/entt/ext/stl/limits.hpp","test/include/entt/ext/stl/memory.hpp","test/include/entt/ext/stl/ostream.hpp","test/include/entt/ext/stl/sstream.hpp","test/include/entt/ext/stl/string.hpp","test/include/entt/ext/stl/string_view.hpp","test/include/entt/ext/stl/tuple.hpp","test/include/entt/ext/stl/type_traits.hpp","test/include/entt/ext/stl/utility.hpp","test/include/entt/ext/stl/vector.hpp","test/lib/dispatcher/plugin/main.cpp","test/lib/dispatcher/plugin/plugin.cpp","test/lib/dispatcher/shared/lib.cpp","test/lib/dispatcher/shared/lib.h","test/lib/dispatcher/shared/main.cpp","test/lib/emitter/plugin/main.cpp","test/lib/emitter/plugin/plugin.cpp","test/lib/emitter/shared/lib.cpp","test/lib/emitter/shared/lib.h","test/lib/emitter/shared/main.cpp","test/lib/locator/plugin/main.cpp","test/lib/locator/plugin/plugin.cpp","test/lib/locator/plugin/userdata.h","test/lib/locator/shared/lib.cpp","test/lib/locator/shared/lib.h","test/lib/locator/shared/main.cpp","test/lib/meta/plugin/main.cpp","test/lib/meta/plugin/plugin.cpp","test/lib/meta/plugin/userdata.h","test/lib/meta/plugin_std/main.cpp","test/lib/meta/plugin_std/plugin.cpp","test/lib/meta/plugin_std/userdata.h","test/lib/meta/shared/lib.cpp","test/lib/meta/shared/lib.h","test/lib/meta/shared/main.cpp","test/lib/registry/plugin/main.cpp","test/lib/registry/plugin/plugin.cpp","test/lib/registry/shared/lib.cpp","test/lib/registry/shared/lib.h","test/lib/registry/shared/main.cpp","test/lib/view/plugin/main.cpp","test/lib/view/plugin/plugin.cpp","test/lib/view/shared/lib.cpp","test/lib/view/shared/lib.h","test/lib/view/shared/main.cpp","test/lib/view/types.h","test/odr.cpp","test/snapshot/snapshot.cpp","testbed/CMakeLists.txt","testbed/application/application.cpp","testbed/application/application.h","testbed/application/context.cpp","testbed/application/context.h","testbed/component/input_listener_component.h","testbed/component/position_component.h","testbed/component/rect_component.h","testbed/component/renderable_component.h","testbed/component/velocity_component.h","testbed/meta/meta.cpp","testbed/meta/meta.h","testbed/system/command_system.cpp","testbed/system/command_system.h","testbed/system/imgui_system.cpp","testbed/system/imgui_system.h","testbed/system/input_system.cpp","testbed/system/input_system.h","testbed/system/movement_system.cpp","testbed/system/movement_system.h","testbed/system/rendering_system.cpp","testbed/system/rendering_system.h","testbed/testbed.cpp"],"storefront":"/r/skypjack","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/skypjack/entt/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}