You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -13,8 +12,7 @@ Flecs is a fast and lightweight Entity Component System that lets you build game
13
12
- Modern type-safe [C++11 API](https://www.flecs.dev/flecs/group__cpp.html) that doesn't use STL containers
14
13
- First open source ECS with full support for [Entity Relationships](https://www.flecs.dev/flecs/md_docs_Relationships.html)!
15
14
- Fast native support for [hierarchies](https://www.flecs.dev/flecs/md_docs_Relationships.html#autotoc_md277) and [prefabs](https://www.flecs.dev/flecs/md_docs_Relationships.html#autotoc_md275)
16
-
- Minimal ECS core with optional [addons](#addons)
17
-
- Entire codebase builds in less than 5 seconds
15
+
- Code base that builds in less than 5 seconds
18
16
- Runs [in the browser](https://flecs.dev/city) without modifications with emscripten
19
17
- Cache friendly [archetype/SoA storage](https://ajmmertens.medium.com/building-an-ecs-2-archetypes-and-vectorization-fe21690805f9) that can process millions of entities every frame
20
18
- Supports entities with hundreds of components and applications with tens of thousands of archetypes
@@ -28,38 +26,25 @@ Flecs is a fast and lightweight Entity Component System that lets you build game
28
26
-[Statistics addon](https://www.flecs.dev/flecs/group__c__addons__stats.html) for profiling ECS performance
29
27
- A web-based dashboard ([demo](https://flecs.dev/explorer), [code](https://github.com/flecs-hub/explorer)) for inspecting entities, running ECS queries and monitoring games:
ECS is a new way of organizing code and data that lets you build games that are larger, more complex and are easier to extend.
31
+
To support the project, give it a star 🌟 !
35
32
36
-
Something is called an ECS when it:
33
+
## What is an Entity Component System?
34
+
ECS is a way of organizing code and data that lets you build games that are larger, more complex and are easier to extend. Something is called an ECS when it:
37
35
- Has _entities_ that uniquely identify objects in a game
38
36
- Has _components_ which are datatypes that can be added to entities
39
37
- Has _systems_ which are functions that run for all entities matching a component _query_
40
38
41
-
For example, a game has a `Move`_system_ that has a _query_ with two _components_, `Position, Velocity`. When the system is ran it is dynamically matched with all _entities_ that have at least these two components.
42
-
43
-
For more info on ECS, check the [ECS FAQ](https://github.com/SanderMertens/ecs-faq)!
44
-
45
-
## Getting Started
46
-
To use Flecs, add the [flecs.c](https://raw.githubusercontent.com/SanderMertens/flecs/master/flecs.c) and [flecs.h](https://raw.githubusercontent.com/SanderMertens/flecs/master/flecs.h) files to your project. When importing the files into a C++ project, make sure to compile [flecs.c](https://raw.githubusercontent.com/SanderMertens/flecs/master/flecs.c) as C code (for example by using `gcc` and `clang` instead of `g++` and `clang++`).
47
-
48
-
The ECS core compiles as C99 code and can be compiled with `-std=c99`. Some addons that are enabled by default require functionality that is not part of C99 for things like measuring time and HTTP sockets (for using the explorer), which can throw compiler errors. To fix these, either compile the code with `-std=gnu99` or add `-D_XOPEN_SOURCE=600`.
49
-
50
-
Flecs can also be built as a standalone library, by using the cmake, meson, bazel or [bake](https://github.com/SanderMertens/bake) build files. If you are using a custom build file to compile Flecs as a library, make sure to define `flecs_EXPORTS`, for example by adding `-Dflecs_EXPORTS` to the compiler command.
39
+
For more information, check the [ECS FAQ](https://github.com/SanderMertens/ecs-faq)!
51
40
52
-
If you want to use the [flecs.c](https://raw.githubusercontent.com/SanderMertens/flecs/master/flecs.c) and [flecs.h](https://raw.githubusercontent.com/SanderMertens/flecs/master/flecs.h) files to build a standalone library, make sure to remove this line from the top of the [flecs.h](https://raw.githubusercontent.com/SanderMertens/flecs/master/flecs.h) file:
If you are building on Windows with mingw/gcc/clang, add `-lWs2_32` to the linker command (only needed for the HTTP/REST addons).
59
-
60
-
Make sure to compile C++ files as at least C++11 by adding `-std=c++0x` or higher to gcc/clang compile commands.
61
-
62
-
By default Flecs includes many features that may not be useful for every project. Builds can be customized to minimize the overhead of the library. See the [Addons](#addons) section for more information on customized builds.
46
+
## Performance
47
+
For a list of regularly tracked benchmarks, see the [ECS Benchmark](https://github.com/SanderMertens/ecs_benchmark) project.
63
48
64
49
## Show me the code!
65
50
C99 example:
@@ -95,6 +80,7 @@ int main(int argc, char *argv[]) {
Flecs has a modular architecture that makes it easy to only build the features you really need. By default all addons are built. To customize a build, first define `FLECS_CUSTOM_BUILD`, then add defines for the addons you need. For example:
188
-
189
-
```c
190
-
#defineFLECS_CUSTOM_BUILD // Don't build all addons
191
-
#define FLECS_SYSTEM // Build FLECS_SYSTEM
192
-
```
193
-
194
-
Additionally, you can also specify addons to exclude from a build by adding `NO` to the define:
[OS API Impl](/flecs/group__c__addons__os__api__impl.html) | Default OS API implementation for Posix/Win32 | FLECS_OS_API_IMPL |
228
-
229
168
## Flecs Hub
230
169
[Flecs Hub](https://github.com/flecs-hub) is a collection of repositories that show how Flecs can be used to build game systems like input handling, hierarchical transforms and rendering.
231
170
@@ -249,8 +188,3 @@ The following language bindings have been developed with Flecs! Note that these
0 commit comments