diff options
author | sanine <sanine.not@pm.me> | 2023-05-12 01:16:46 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-05-12 01:16:46 -0500 |
commit | 3275ae4948fd2c1bb8da780214cbb741dc3178be (patch) | |
tree | 69dbf1d5b56896e1212454e5f79daaec1d201ec1 /honey/notes.md | |
parent | 14195dac1eda9140192ca07003258715b8b0abd3 (diff) |
begin refactor
Diffstat (limited to 'honey/notes.md')
-rw-r--r-- | honey/notes.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/honey/notes.md b/honey/notes.md new file mode 100644 index 0000000..5dd25e7 --- /dev/null +++ b/honey/notes.md @@ -0,0 +1,23 @@ +avoid closures where possible; they lead to weird garbage collector effects! + + +assets +------ + +assets are cached. each asset type has a module (e.g. `mesh`, `image`, `sound`, etc). These have the following functions: + + * `get(filename)` - cached load of the given file. throws error if it cannot be found + * `forget(filename` - remove the cached copy, if any of the given file + * `clearCache()` - clear the full cache for that asset type + +individual assets may have additional functions. + + +systems +------- + +systems are pure functions (NOT closures!!). they can be embedded in tables that indicate dependencies, i.e. which other systems *must* execute before them in order for things to work correctly. They have a signature like + +> `system(db, dt, [params])` + +where params is a table. all parameters, including the params table, are passed in by the systemdb every frame; the system should NEVER close over them. |