Skip to content

OpenECS 0.3.0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 16 Oct 04:37
· 840 commits to dev since this release
60899b8

OpenECS 0.3.0 lets panels draw on the GPU, and Lua plugins run work on threads of their own. Plugins pass more to each other: functions they keep, buffers and handles in values, and methods on handles. Message dialogs are drawn by OpenECS itself, every tool can go to another, and presets can tell a new user what to try first.

It comes out with the releases of the two repositories that OpenECS ships, each described in its own release:

  • OpenECS-std 0.3.0: two new standard plugins, web for HTTP, HTTPS and WebSockets, and gpu, which draws on the GPU; and much more in ui, mixer, gltf, image, textgrid, net and fs.
  • OpenECS-examples 0.3.0: four new examples, on web, workers and the GPU, and the new functions in the examples of 0.2.0.

This is still an early release. Plugins made for 0.2.0 need the changes under "What will break".

What you can do

Draw on the GPU.

  • A panel type with surface = "gpu" in Lua, or ECSSurfaceType_Gpu in C, draws into a texture on the GPU. The texture shows in any window the panel moves to, without being made again.
  • Draw into it with the gpu standard plugin, from Lua or C: shapes, textures, text, and your own shaders.
  • Or draw into it with SDL's GPU API in C. ECSGpu_GetDevice() gives the GPU device, and the surface gives the texture.
  • ECSSurface_OnDrawn runs a function once a panel's draw returns, so a service that draws into surfaces can finish its work itself.

Run work on threads. ecs.worker.start{ file = "count.lua", input = 1000, message = ..., done = ... } runs a Lua script on a thread of its own, in a Lua state of its own, so the panels stay free while it works.

  • Values go both ways as copies: worker:send(value) and, in the script, ecs.worker.receive() and ecs.worker.send(value).
  • The plugin's message and done functions get them on the main thread.
  • worker:stop() ends the script. OpenECS stops every worker and waits for it before it exits.

Pass more between plugins.

  • Kept functions: a signature can take keep fn<signature>, a function that stays valid after the call, such as a function to call when a download is done. ECSService_ReleaseCallback lets it go.
  • Buffers and handles in values: events, saved state and generic values can hold bytes and handles. In Lua, a text with a zero byte becomes a buffer, and a handle stays a handle.
  • Methods on handles: ECSHandle_AddMethod, and ecs.handle.addMethod in Lua, make a function a method of a handle type, so Lua writes connection:send(data) for net.send(connection, data).
  • Typed values: a signature can name a value's Lua type, such as value<ui.ButtonProps>. A plugin's types.lua describes those types, so your editor completes the tables you pass.
  • More for C plugins: a plugin's header.h goes into the definition header that --definitions writes, as ui's macros do. A key event gives the key's name in C too, so C code needs no SDL to read it.

Answer questions in OpenECS's own dialogs. Message dialogs, such as the question about unsaved work, are drawn by OpenECS over its window, in place of the system's message boxes. Return, Space, the arrows, Tab and Escape answer them, or a click.

Go to another tool from any tool. Every tool loads the launcher. Alt+W, then / opens it, and lists your presets and saved sessions.

Help new users of your tool. A preset's hint, such as "Drag to draw; Ctrl+Z undoes", shows in the title bar after the tool's name.

Test more.

  • test.pixel(x, y) gives the colour that the window shows at a point, also over a GPU panel.
  • test.dialog() gives the dialog that waits for an answer, and the test answers it with keys or clicks.
  • test.keyEvent sends one press or release of a key, with its time, as an input method does.
  • The tests of GPU panels run on Mesa's software Vulkan driver, with no graphics card.

Find input problems. --log-input logs each key and text event as SDL gives it.

Small fixes

  • An input method that repeats a held key, such as fcitx5 on Wayland, no longer types it twice.
  • Text that comes without a key press, such as an input method's, is no longer lost after a key binding with Ctrl, Alt or Super.
  • Key combinations of keys whose names hold a +, such as Ctrl++, work.
  • A call from Lua that leaves out its last arguments gets nil for them.
  • A handle made while another handle of the same object waits to be collected no longer loses its object.
  • A plugin's Destroy can still call other plugins' functions.
  • Building from source is faster: shuild compiles a module's files in parallel, as many at a time as there are processors. It also copies, lists and deletes files itself, so the build scripts no longer run cp, find, cmp or rm.

What will break

Names with abbreviations. Abbreviations are written in capitals:

  • In C, ECSPanel_GetID replaces ECSPanel_GetId.
  • The lists of presets and sessions give appID, in place of appId.

Keys.

  • The panel list opens on Alt+W, then ., in place of Alt+W, then N.
  • The launcher opens on Alt+W, then /.
  • A settings file that set N for the panel list keeps working. Remove it to use ..

The launcher. launcher.open now opens the launcher, and launcher.start starts the chosen entry, as OpenECS-std 0.3.0 says.

Examples. 18_first_party is now 19_first_party.

Tests. The tests need a Vulkan driver for the GPU panels of 21_gpu: one for your graphics card, or Mesa's software one, such as mesa-vulkan-drivers on Debian and Ubuntu.

Downloads

  • openecs-0.3.0-linux-x86_64.tar.gz: the program with SDL's libraries, its plugins, presets and examples, the plugin interface, and the licenses. Unpack it and run OpenECS.
  • openecs-0.3.0-source.tar.gz: the source with every library it uses. GitHub's own "Source code" archives leave the libraries out, so use this one to build.
  • SHA256SUMS: checksums of the archives.

Only Linux on x86_64 has a build. It needs glibc 2.38 or later, such as Ubuntu 24.04 or Fedora 39.

OpenECS is under the zlib license.