Repository navigation
OpenECS-examples 0.6.0
Pre-releaseOpenECS-examples 0.6.0 adds eight examples: c14_structs for the plugin interface's structs, and s11_parse to s17_notify for the new standard plugins. s7_first_party enables and disables plugins while the tool runs. The release has the examples built for Linux and Windows.
It comes out with OpenECS 0.6.0, which ships these examples, built, in its examples/ folder, and OpenECS-std 0.6.0, whose plugins they use.
Run an example from OpenECS's folder:
./OpenECS --fresh --preset examples/s16_sqlite/preset.luaWhat you can learn
Structs. c14_structs has a C plugin's vec2 struct, with methods and operators, which a Lua panel uses as a table: it measures a clicked path with a - b and v:length().
Data formats. s11_parse writes a table in JSON, TOML, INI, .env and CSV, reads each text back, and shows that it reads back the same.
Compression. s12_compress packs its own file with gzip, zlib, deflate and zstd and unpacks it, then writes a zip archive, lists it and reads a file back.
Programs. s13_process runs sort with an input, then starts the shell beside the tool and reads its output and errors from a timer.
Gamepads. s14_gamepad shows every gamepad that is plugged in, from gamepad's events. Space plugs in a virtual gamepad that the keyboard drives.
Hashes. s15_hash hashes a text with each algorithm, and its own file whole and in parts, which give the same hash.
SQLite. s16_sqlite keeps a table in a database in memory: it creates it, adds and updates rows with parameters, and shows a query. Return adds a row.
Notifications and tray icons. s17_notify sends notifications with buttons and shows a tray icon with a menu; the panel lists what the user clicks. Return sends one.
Enabling and disabling plugins. In s7_first_party, the plugin list disables and enables plugins while the tool runs. A new plugin, badges, needs shapes: disabling shapes disables badges too, and enabling badges enables shapes. Its test also opens the tool's menu.
cglm's structs. s10_cglm's cube multiplies its matrices with * and reads a projected point's x and y. The C cube passes CglmVec3 and CglmMat4 by pointer. s9_gpu_model joins the bytes of its matrices and vectors into uniforms.
Small fixes
c12_sketch's Lua panel paints each row of a dab with one fill, and makes each colour's text once, as each call from Lua to the core has a cost.s6_websays that web uses HTTP/2 and asks for compressed answers.
What will break
cglm. s9_gpu_model and s10_cglm use cglm's structs, so they need OpenECS-std 0.6.0. Code copied from their 0.5.0 versions must change as OpenECS-std's release says.
Plugin API. The examples' plugins use plugin API version 2, and need OpenECS 0.6.0.
Downloads
openecs-examples-0.6.0-linux-x86_64.tar.gzandopenecs-examples-0.6.0-windows-x86_64.zip: the examples built. Unpack one into an OpenECS 0.6.0 folder.openecs-examples-0.6.0-source.tar.gz: the examples' source. Build them inside a checkout of OpenECS, as README.md says.SHA256SUMS: checksums of the archives.
The examples are under the zlib license.