Skip to content

Commit 0f552fc

Browse files
committed
Move build instructions from README to Quickstart, cleanup
1 parent 2b0a2d8 commit 0f552fc

File tree

3 files changed

+145
-173
lines changed

3 files changed

+145
-173
lines changed

README.md

Lines changed: 14 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
![flecs](docs/img/logo.png)
22

3-
## Introduction
43
[![Version](https://img.shields.io/github/v/release/sandermertens/flecs?include_prereleases&style=for-the-badge)](https://github.com/SanderMertens/flecs/releases)
54
[![MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge)](/LICENSE)
65
[![Documentation](https://img.shields.io/badge/docs-flecs-blue?style=for-the-badge&color=blue)](https://www.flecs.dev/flecs/md_docs_Docs.html)
@@ -13,8 +12,7 @@ Flecs is a fast and lightweight Entity Component System that lets you build game
1312
- Modern type-safe [C++11 API](https://www.flecs.dev/flecs/group__cpp.html) that doesn't use STL containers
1413
- First open source ECS with full support for [Entity Relationships](https://www.flecs.dev/flecs/md_docs_Relationships.html)!
1514
- 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
1816
- Runs [in the browser](https://flecs.dev/city) without modifications with emscripten
1917
- 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
2018
- 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
2826
- [Statistics addon](https://www.flecs.dev/flecs/group__c__addons__stats.html) for profiling ECS performance
2927
- 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:
3028

31-
[![Dashboard image](docs/img/explorer.png)](https://flecs.dev/explorer)
29+
[![Flecs Explorer](docs/img/explorer.png)](https://flecs.dev/explorer)
3230

33-
## What is an Entity Component System?
34-
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 🌟 !
3532

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:
3735
- Has _entities_ that uniquely identify objects in a game
3836
- Has _components_ which are datatypes that can be added to entities
3937
- Has _systems_ which are functions that run for all entities matching a component _query_
4038

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)!
5140

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:
41+
## Documentation
42+
- [Quickstart](https://www.flecs.dev/flecs/md_docs_Quickstart.html)
43+
- [Examples](https://github.com/SanderMertens/flecs/tree/master/examples)
44+
- [All Documentation](https://www.flecs.dev/flecs/md_docs_Docs.html)
5345

54-
```c
55-
#define flecs_STATIC
56-
```
57-
58-
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.
6348

6449
## Show me the code!
6550
C99 example:
@@ -95,6 +80,7 @@ int main(int argc, char *argv[]) {
9580
```
9681
9782
Same example in C++11:
83+
9884
```cpp
9985
struct Position {
10086
float x, y;
@@ -160,9 +146,6 @@ https://www.flecs.dev/city ([repository](https://github.com/flecs-hub/city))
160146

161147
## Resources
162148

163-
### Documentation
164-
- [Flecs Documentation](https://www.flecs.dev/flecs/index.html)
165-
166149
### Resources provided by the community :heart:
167150
- [Unreal Minimum Viable Flecs Project](https://github.com/PreyK/Unreal-Minimum-Viable-Flecs)
168151
- [Bgfx/Imgui module](https://github.com/flecs-hub/flecs-systems-bgfx/tree/bgfx_imgui)
@@ -176,56 +159,12 @@ https://www.flecs.dev/city ([repository](https://github.com/flecs-hub/city))
176159
- [Flecs + gunslinger example](https://github.com/MrFrenik/gs_examples/blob/main/ex_demos/flecs/source/main.c)
177160
- [Flecs based 3D game engine with editor](https://bit.ly/3T9cc1o)
178161

179-
### Flecs links
162+
### Flecs around the web
180163
- [Discord](https://discord.gg/BEzP5Rgrrp)
181164
- [Medium](https://ajmmertens.medium.com)
182-
- [ECS FAQ](https://github.com/SanderMertens/ecs-faq)
183165
- [Twitter](https://twitter.com/ajmmertens)
184166
- [Reddit](https://www.reddit.com/r/flecs)
185167

186-
## Addons
187-
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-
#define FLECS_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:
195-
196-
```c
197-
#define FLECS_NO_LOG
198-
```
199-
200-
The following addons can be configured:
201-
202-
Addon | Description | Define |
203-
--------------|--------------------------------------------------|---------------------|
204-
[Cpp](/flecs/group__cpp.html) | C++11 API | FLECS_CPP |
205-
[Module](/flecs/group__c__addons__module.html) | Organize game logic into reusable modules | FLECS_MODULE |
206-
[System](flecs/group__c__addons__system.html) | Create & run systems | FLECS_SYSTEM |
207-
[Pipeline](/flecs/group__c__addons__pipeline.html) | Automatically schedule & multithread systems | FLECS_PIPELINE |
208-
[Timer](/flecs/group__c__addons__timer.html) | Run systems at time intervals or at a rate | FLECS_TIMER |
209-
[Meta](/flecs/group__c__addons__meta.html) | Flecs reflection system | FLECS_META |
210-
[Meta_C](/flecs/group__c__addons__meta_c.html) | (C) Utilities for auto-inserting reflection data | FLECS_META_C |
211-
[Units](/flecs/group__c__addons__units.html) | Builtin unit types | FLECS_UNITS |
212-
[Expr](/flecs/group__c__addons__expr.html) | String format optimized for ECS data | FLECS_EXPR |
213-
[JSON](/flecs/group__c__addons__json.html) | JSON format | FLECS_JSON |
214-
[Doc](/flecs/group__c__addons__doc.html) | Add documentation to components, systems & more | FLECS_DOC |
215-
[Coredoc](/flecs/group__c__addons__coredoc.html) | Documentation for builtin components & modules | FLECS_COREDOC |
216-
[Http](/flecs/group__c__addons__http.html) | Tiny HTTP server for processing simple requests | FLECS_HTTP |
217-
[Rest](/flecs/group__c__addons__rest.html) | REST API for showing entities in the browser | FLECS_REST |
218-
[Parser](/flecs/group__c__addons__parser.html) | Create entities & queries from strings | FLECS_PARSER |
219-
[Plecs](/flecs/group__c__addons__plecs.html) | Small utility language for asset/scene loading | FLECS_PLECS |
220-
[Rules](/flecs/group__c__addons__rules.html) | Powerful prolog-like query language | FLECS_RULES |
221-
[Snapshot](/flecs/group__c__addons__snapshot.html) | Take snapshots of the world & restore them | FLECS_SNAPSHOT |
222-
[Stats](/flecs/group__c__addons__stats.html) | See what's happening in a world with statistics | FLECS_STATS |
223-
[Monitor](/flecs/group__c__addons__monitor.html) | Periodically collect & store statistics | FLECS_MONITOR |
224-
[Log](/flecs/group__c__addons__log.html) | Extended tracing and error logging | FLECS_LOG |
225-
[Journal](/flecs/group__c__addons__journal.html) | Journaling of API functions | FLECS_JOURNAL |
226-
[App](/flecs/group__c__addons__app.html) | Flecs application framework | FLECS_APP |
227-
[OS API Impl](/flecs/group__c__addons__os__api__impl.html) | Default OS API implementation for Posix/Win32 | FLECS_OS_API_IMPL |
228-
229168
## Flecs Hub
230169
[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.
231170

@@ -249,8 +188,3 @@ The following language bindings have been developed with Flecs! Note that these
249188
- [Zig #1](https://github.com/foxnne/zig-flecs) [#2](https://github.com/prime31/zig-flecs)
250189
- [C# #1](https://github.com/flecs-hub/flecs-cs) [#2](https://git.mcft.net/copygirl/gaemstone.ECS)
251190
- [Rust](https://github.com/jazzay/flecs-rs)
252-
253-
## Supporting Flecs ♥️
254-
Supporting Flecs goes a long way towards keeping the project going and the community alive! If you like the project, consider:
255-
- Giving it a star 🌟
256-
- Becoming a sponsor: https://github.com/sponsors/SanderMertens

0 commit comments

Comments
 (0)