Skip to content

Releases

OpenECS-std 0.8.0

OpenECS-std 0.8.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 03 Dec 06:58
40fff48

OpenECS-std 0.8.0 adds history, which gives any tool undo and redo, and a Spacer panel. ui gains boards of blocks and wires, popups of its own elements, icons and labels, panel types in a line, and long lists that build only what shows; it draws on the GPU by default, and its callbacks are named by what they mean. fs reads, writes, moves, copies, removes and trashes files. The files panel shows a tree of folders beside a grid, and the console takes in the log, with sources, a Show level and a Sort. The Lua plugins run on LuaJIT 2.1, and the license is 0BSD. The release has the plugins built for Linux and Windows.

It comes out with OpenECS 0.8.0, which ships these plugins built, in its plugins/ folder. The examples of OpenECS-examples 0.8.0 use them.

What you can do

Undo and redo in any tool. history keeps histories by name. A plugin pushes a record for each change with history.push, with the functions that undo and redo it, or history.change for one value; records with the same merge key, close in time, join, so a drag is undone at once. history.use(panel, h) names a panel's history, and history.useDefault(h) the tool's. Ctrl+Z and Ctrl+Y act on the focused panel's history, from Lua and C alike. The History panel, the prefix then H, lists the records with their tags, and a click goes to one.

Build node editors. ui.board shows blocks at their places, ui.block, with pins, ui.pin, and wires between them. The wheel zooms around the pointer, and the middle button moves the view. Presses, Shift, Ctrl and a rectangle choose blocks through onSelect; a drag gives onMove at the release; a pin's drag draws its wire to the pointer and rings the pins that take it. ui.fit frames the blocks, and ui.boardPoint turns a panel's point into the board's. From C: UI_BOARD, UI_BLOCK, UI_PIN and UI_OPENED_BLOCK.

Show ui's elements in a popup. ui.popup(panel, desc) opens a popup whose elements a view gives, as a panel's are, with its own background and border; a field in it takes typed text. In C, Ui_OpenPopup. The dropdown's choices and the colour picker are such popups.

Register a panel type in a line. ui.panelType(desc) completes a panel type with ui's part: its view(state, surface) gives the elements, and its own event gets only the events ui did not take. In C, Ui_PanelType with a View that describes with the macros.

Draw on the GPU. ui draws its panels with gpu, where gpu can draw, and with draw elsewhere. The setting ui.gpu, on by default, chooses. gpu gains outline, circle, rounded, roundedOutline, clip and styled text, as draw has them, and gpu.available. gpu.text keeps its texts' layouts.

Show icons and labels. ui.icon(name) draws a small picture from shapes: an eye and a padlock, open and shut, the tools move, turn, scale, rect and shape, and a player's play, pause, step and stop, among others. A button, a section's heading, a tree's node and mark, and a selector's and tabs' choices take a label: a text, or spans that hold icons and images. A selector's choices may each have their own tooltip and keys. In C, UI_ICON and UI_LABEL.

Show an image made in memory. ui.image takes an image of draw in place of a file's path. When draw.setImagePixels changes it, the panel's next show shows the new pixels; draw.imageVersion tells a plugin that keeps a copy when to copy again.

Build long lists and trees. A list builds only the items in view: ui.range(panel, id, count) gives the first and last to build, and the list takes count and first. Every tree does it by itself. A list's anchor, "start" or "end", keeps its place as items come, so a log's newest show and the item being read stays still.

Agree on one way for lists. In every list, table and tree, a press chooses an item (onSelect), and a double click or Return goes to it (onOpen). A tree's arrow, or Right and Left, opens and closes a node. A tree's marks are labels at the end of a node's row that a click turns on and off through onMark.

More in ui.

  • Data dragged over a panel shows where it would land: a line before or after an item, or a box around it. onDragOver takes or refuses it. Any element with onDrag drags, and C has onDrag, onDragOver, onDrop and onMenu as functions in UiProps.
  • A number field's drag and a slider's drag give onChange its value with dragging true, so a tool shows a dragged value at once and waits for a typed one's Return.
  • A text's maxLines shows at most that many lines, the last with an ellipsis. Its wrapMark, such as "↪ ", starts each line after a break, and its gutter, such as a line's number, stands before its first line.
  • A dropdown's folders shows its texts in folders, and a menu entry's submenu opens beside the menu.
  • Tooltips show in popups of their own, over other panels, through the core's tooltip.
  • ui is denser and in the theme's colours, with rounded controls by the setting ui.radius, and an element's keys names its key combination in its tooltip.
  • A double click is the system's: its time, and its count of clicks.
  • In C, UI_CHANGED(id) and UI_SUBMITTED(id) say what changed for any element described before in the show.

Work with files. fs reads and writes files, fs.read, fs.readPart and fs.write, which writes whole or not at all; moves and copies files and folders, fs.move and fs.copy, across drives too; removes them, fs.remove; and moves them to the system's trash, fs.trash, on Linux and Windows. Where a drive has no trash, they go to the folder of the setting fs.trashFolder. fs.watch(folder, changed, true) watches the folders inside too.

Find files in a tree and a grid. The files panel shows a tree of folders on its left, and a grid of the chosen folder's folders and files on its right, with a divider between them and a Folders toggle. Files and folders show their pictures, and a tool gives them its own with icon. Delete moves into the trash. The panel takes dropped files: a file of its folder moves, and one from elsewhere is copied under a free name, such as apple 2.png. files.reveal(path) shows a file in every shown files panel that is not locked; the Lock toggle and files.lock keep a panel where it is. files.selected and files.toggleTree serve keys.

Read the log in the console. The console takes in every line of the log, by its plugin. An entry has a source, which console.add takes, and checkboxes show some sources only, with their counts. Show shows the entries from a level up, Error, Warning, Info or Debug, and Sort orders them, Newest first, Oldest first, Level or Source; the settings console.show and console.sort start a new console. A console that is not shown counts its new entries in a badge after its title, in the colour of the worst. An entry's count of repeats stands out in its level's colour.

More in the others.

  • The panel type panels.spacer, titled Spacer, fills a place in the layout, such as a split's other side.
  • settings.show(name) opens the settings window at a setting.
  • The key list shows a plugin's keys for all its panels in a section of their own. The keys after the prefix show in a popup while OpenECS waits for one.
  • The plugins' own windows bind their keys after the prefix and add Open entries to the title bar's menu Tools.
  • The profiler's Functions tab shows the Lua functions that took the most time.
  • The viewer numbers a text's lines, and marks the rows a long line wraps into.
  • draw's move moves a rectangle's pixels, and fontStyle gives a font's style. draw's mono font is OpenECS's JetBrains Mono by default.
  • net.listen and net.listenTLS take a host, such as 127.0.0.1 for this computer's programs only, and port 0 picks a free port, which net.port tells.
  • process.start and process.run take an environment, a list of NAME=VALUE texts.

Small fixes

  • ui is faster: it draws again only the rectangles that changed, moves the pixels of a scroll that alone scrolled, keeps wrapped and measured texts, and reuses its elements' tables. draw fills rounded shapes and circles many times faster.
  • process.run sends a large input while it reads the output, and a Windows pipe takes large writes.
  • textgrid shows the cursor of a full row on its last column.
  • Italic text measures as wide as it draws, so italic spans leave no gap.
  • parse fails with why on data nested deeper than 512, and compress and web fail when memory runs out, in place of stopping the program.
  • regex's replace writes its count as an int.
  • fs.remove removes folders on Windows.
  • Each plugin compiles its own stb_ds.

What will break

Plugin API 4 and LuaJIT. Every plugin's manifest says api = 4, so the plugins need OpenECS 0.8.0. Change api = 3 to 4 in your own plugins. Lua plugins run on LuaJIT 2.1, as OpenECS 0.8.0 says: Lua 5.4's //, math.type, math.tointeger and string.pack are gone.

ui's callbacks. Each callback means one thing on every element:

  • A selector's, tabs' and dropdown's onSelect(selected) is onChange(selected).
  • A section's onToggle(open) is onChange(open).
  • A list's, table's and tree's onActivate is onClick. Return gives the item to onOpen, or to onClick without one.
  • onChange runs only for another value: a dropdown's same choice, or a number, key, colour or path's chosen file that is the same, gives nothing.

ui's menus. ui.menu is gone: open the core's menu with panel:openMenu(entries), as files and console do.

ui's elements. An element lives until its panel's next show, so showing one element table twice is a misuse: make it again. A dropdown's choices must be texts.

ui in C.

  • Ui_Menu, `UiMenuEnt...
Read more

OpenECS-std 0.7.0

OpenECS-std 0.7.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 18 Nov 13:47
d6c9112

OpenECS-std 0.7.0 adds seven plugins: files, viewer and console, which a tool shows its project with; regex, markdown, syntax and video. It adds the profiler and the key list, which every tool loads. ui gains search, menus, sections, colour pickers, paths, graphs, dragging and dropping, and draws only what changed. The release has the plugins built for Linux and Windows.

It comes out with OpenECS 0.7.0, which ships these plugins built, in its plugins/ folder. The examples of OpenECS-examples 0.7.0 use them.

What you can do

Show a project's files. files is a panel of a folder, as a tree or as a grid of tiles. A search shows only the files whose name holds its text. A right click opens a menu: New for a folder and for each kind of file the tool gives, then Open, Rename and Delete. Show in file manager opens the system's file manager on the file. The tree drags a file onto other panels.

Look at a file. viewer shows a file as it is: text, with its code coloured, images and sounds. Its lines and path wrap at the panel's width.

Show a program's output. console keeps entries that other plugins add, each framed in its level's colour, with its time. A file and line that an entry names, such as main.lua:12, is a link that opens the file in your code editor, with the command of console.editor. An entry equal to the last one stacks with a count. Toggles and a search filter the entries. A click chooses an entry, a double click goes to its place, a right click opens Go to and Copy, and Ctrl+C copies it. On Windows, console.editor finds code as code.cmd.

See where the time goes. The profiler, Alt+W then F, shows each plugin's own time, each panel's draw and each step of the frames, as OpenECS measures them while Measure is on. A graph shows the last frames. Copy report puts it all on the clipboard as text.

Change any key. The key list, Alt+W then K, shows every key binding by scope. A click on a key and a new key press give its function that key; Remove takes a key away, Reset goes back to the preset's, and Add a key binds any function. The changes go into your settings.

Find text with regular expressions. regex compiles patterns with PCRE2: test, match, matchAll, replace, split and escape, with named groups.

Show Markdown. markdown reads Markdown with md4c into a tree of nodes, or into ui's elements, with emphasis, code and links in their styles.

Colour code. syntax highlights C, Lua and JSON with tree-sitter, as ranges by kind or as ui's spans for each line.

Play video. video plays MPEG-1 files with their sound, with pl_mpeg: play, pause, seek, loop, volume, and draw into a panel.

Build views faster with ui.

  • ui.search is a search field, which Ctrl+F reaches, and ui.matches matches each word. The settings window, the launcher, the panel list and the plugin list have one.
  • ui.menu opens a menu at a point, such as where a right click was; onMenu gives the place.
  • ui.section is a heading that shows and hides its children; ui.color is a swatch with a picker; ui.path is a field with a button that opens a file dialog; ui.graph draws bars of numbers, which stack in colours.
  • Lists, tables and trees choose many items with Ctrl and Shift, and drag their items with onDrag. Data dropped on a panel goes to the element with onDrop.
  • A text may be a list of spans, each with its style, colour and link. A field shows a placeholder while it is empty. A number field takes a sum, such as 32*4, and a drag sideways changes it. A row with wrap = true breaks into lines. A slider gives onSubmit the value its drag ends on.
  • Styles are values that a variable keeps, with ui's own from ui.styles(). ui.inspect outlines every element and names the one under the pointer.
  • ui.show draws only what changed since the last show, so a hover no longer redraws a whole panel.

More in the others. compress makes and reads tar archives. draw makes a font bold, italic, underlined or struck, and replaces an image's pixels. net's error tells why a connection failed. The settings window resets a setting you changed.

Small fixes

  • Every function that can fail outside its caller gives nil and why, and a wrong argument is a misuse that stops the caller (OpenECS DESIGN 1.4). Plugins no longer log the failures they return.
  • textgrid's cell and fit take the surface's scale, so their cells are the drawn ones.
  • The SQLite library is built as sqlite3, so a second build no longer compiles it and the sqlite plugin again.
  • fs's watches tell overflow when changes were lost and gone when the folder is.
  • gpu builds without gcc's analyzer warnings, and hash with gcc 16.

What will break

Plugin API 3. Every plugin's manifest says api = 3, so the plugins need OpenECS 0.7.0. Change api = 2 to 3 in your own plugins.

Errors. A function that fails gives nil and why, in place of logging. Registrations, such as ecs.service.register and ecs.key.bind, raise on a misuse and return nothing, so assert(...) around them fails: drop the assert.

ui.

  • ui.tree(nodes, props) and ui.table(columns, rows, props) take their props last.
  • Selectors, tabs and dropdowns take selected and onSelect, a number from 1.
  • The settings ui.margin, ui.rowPadding, ui.titleSize and ui.noteSize are gone: use ui's styles.
  • A prop that ui does not know, and an id that two elements share, are a misuse.
  • draw.measure takes the surface's scale.

textgrid. textgrid.cell(size, scale) and textgrid.fit(width, height, size, scale) take the scale.

Building. std's build compiles PCRE2, md4c, tree-sitter with its grammars, and pl_mpeg too. Update the submodules first, as README.md says.

Downloads

  • openecs-std-0.7.0-linux-x86_64.tar.gz and openecs-std-0.7.0-windows-x86_64.zip: the plugins built, as above, with the licenses of the libraries in them.
  • openecs-std-0.7.0-source.tar.gz: the source with the libraries it compiles in. Build it inside a checkout of OpenECS, as README.md says.
  • SHA256SUMS: checksums of the archives.

The standard plugins are under the zlib license. The libraries in dependencies/ keep their own licenses, which OpenECS's release lists.

OpenECS-std 0.6.0

OpenECS-std 0.6.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 09 Nov 11:29
4a952a4

OpenECS-std 0.6.0 adds eight plugins: parse, compress, process, gamepad, hash, sqlite and notify, and the plugin list. web speaks HTTP/2 and takes compressed answers. cglm's vectors and matrices are structs, with methods and operators. The release has the plugins built for Linux and Windows.

It comes out with OpenECS 0.6.0, which ships these plugins built, in its plugins/ folder. The examples of OpenECS-examples 0.6.0 use them.

What you can do

Read and write data formats. parse reads and writes JSON, TOML, INI, .env and CSV texts as values: parse.json.read(text) and parse.json.write(value), and the same for the others. A text that cannot be read gives nothing and why, with the line. Writes sort named fields, so the same data gives the same text.

Pack and unpack. compress packs and unpacks gzip, zlib, deflate and zstd, such as compress.gzip.pack(data), and compress.unpack(data) tells gzip, zlib and zstd by their first bytes. compress.zip lists, reads, writes and extracts zip archives; an extract refuses entries that would go outside its folder.

Run programs. process.run(command, folder, input) runs a short program to its end and gives its output. process.start(command, folder) gives a handle whose read, readErrors, write, closeInput, exited and kill never block the tool. A program whose handle is gone is killed.

Read gamepads. gamepad.list() and gamepad.open(id) give the gamepads that are plugged in, whose buttons, sticks and triggers have SDL's names: pad:button("a"), pad:axis("leftx"), pad:rumble(low, high, seconds). The events gamepad.added, gamepad.removed, gamepad.button and gamepad.axis tell what changes, so nothing polls. gamepad.attachVirtual(name) plugs in a virtual gamepad, for tests and for tools that turn other input into a gamepad's. The setting gamepad.background reads the gamepads while another program has the focus.

Hash data. hash.of(algorithm, data) gives a CRC-32, MD5, SHA-1, SHA-256, SHA-512, XXH64, XXH3 or XXH128 as hexadecimal text, as sha256sum and xxhsum write it. hash.new(algorithm) takes the data in parts, such as a large file's, with hasher:update(data) and hasher:digest().

Keep records in SQLite. sqlite.open(path) opens a database file, or ":memory:". database:query(sql, parameters) gives the rows as tables of their columns, with ? or :name parameters, so a value never becomes part of the SQL. exec, changes, lastId and close do the rest. Full-text search and the math functions are in.

Show notifications and tray icons. notify.send(notification) shows a desktop notification, with buttons, an image and a priority. notify.tray(tray) shows a tray icon with a menu of entries and checkboxes. Clicks come back as the events notify.action, notify.trayEntry and notify.trayClicked.

Enable and disable plugins while the tool runs. The plugin list, a first-party plugin, lists every plugin in the plugin folders and enables or disables one. It refreshes when the plugins change.

Download faster with web. web uses HTTP/2 over HTTPS, and asks for answers compressed with gzip, deflate or zstd; the body comes unpacked.

Do 3D math with operators. cglm's vec2, vec3, vec4 and quat have the fields x, y, z and w, and mat4 is a list of 16 floats. a + b, v * s, m1 * m2 and p * q work, and so do methods such as v:normalize() and m:inv(). bytes gives a struct's floats for a shader's uniforms. C plugins pass them as CglmVec3 and CglmMat4, by pointer.

Small fixes

  • ui: a text without wrap keeps its own lines, each cut with an ellipsis, so it no longer draws over what follows it. Wrapped text keeps the blanks a line starts with.
  • cglm.mat4Inv gives zeros for a matrix without an inverse.
  • The launcher's preset is format 2, with the category of its desktop entry.

What will break

cglm. Vectors, quaternions and matrices are structs, not buffers of floats. Read their fields, such as v.x, in place of cglm.components, which is gone. Pass v:bytes() where a buffer is needed, such as a shader's uniforms. C plugins pass CglmVec3, CglmMat4 and the others by pointer.

OpenECS. The plugins need OpenECS 0.6.0: cglm's structs and the plugin list use its new functions. They still use plugin API version 2.

Building. std's build compiles SQLite, xxHash, yyjson, tomlc17, zlib, zstd and nghttp2 too. Update the submodules first, as README.md says.

Downloads

  • openecs-std-0.6.0-linux-x86_64.tar.gz and openecs-std-0.6.0-windows-x86_64.zip: the plugins built, as above, with the licenses of the libraries in them.
  • openecs-std-0.6.0-source.tar.gz: the source with the libraries it compiles in. Build it inside a checkout of OpenECS, as README.md says.
  • SHA256SUMS: checksums of the archives.

The standard plugins are under the zlib license. The libraries in dependencies/ keep their own licenses, which OpenECS's release lists.

OpenECS-std 0.5.0

OpenECS-std 0.5.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 28 Oct 12:56
c7d787b

OpenECS-std 0.5.0 adds cglm, a plugin that gives cglm's vectors, matrices and quaternions to Lua and C. gpu compiles shaders from GLSL, on every system, with nothing to download. The release has the plugins built for Linux and Windows.

It comes out with OpenECS 0.5.0, which ships these plugins built, in its plugins/ folder. The examples of OpenECS-examples 0.5.0 use them.

What you can do

Do 3D math in Lua. cglm binds the cglm library: vectors, matrices, quaternions, cameras and noise. Each vector, quaternion and matrix is a buffer of floats, as shaders take them, and each function is named as cglm's: glm_mat4_mul is cglm.mat4Mul. C plugins call the same functions through cglm.h.

Write shaders in GLSL. gpu.shader takes glsl source, version 450, which glslang compiles to SPIR-V. On Windows, where Direct3D 12 does not take SPIR-V, gpu turns it into HLSL with SPIRV-Cross and compiles that with Windows' own compiler.

  • gpu.compile(source, stage) gives the SPIR-V of a GLSL source, or glslang's message, so a plugin can show a shader's errors.
  • gpu counts a shader's uniform blocks and textures from its SPIR-V when the description leaves them out.

Clip a part of a draw. draw.clip(surface, x, y, width, height, body) clips while body runs. Clips nest, and a clip ends when body returns, also when it fails.

Watch folders on Windows as on Linux. fs uses the system's own notifications on Windows, ReadDirectoryChangesW, as it uses inotify on Linux. Other systems read the folders again every half second.

Install the plugins from the release. openecs-std-0.5.0-linux-x86_64.tar.gz and openecs-std-0.5.0-windows-x86_64.zip hold plugins/, presets/ and the plugins' definition files in include/. Unpack one into an OpenECS 0.5.0 folder.

Small fixes

  • Lists in ui handle Up, Down and Return themselves, and trees Left and Right too. ui's separator vertical works.
  • ui's C header has every element that Lua's ui has, such as UI_TABLE, UI_SORTED and UI_TREE.
  • draw's "ui" font follows ecs.font when it changes, and a ring from circle is at least a pixel thick.
  • textgrid's put and print no longer write control characters into cells.
  • draw.newImage and mixer.newSound no longer crash when memory runs out.
  • gpu frees a buffer whose upload failed; audio says why a stream cannot be opened.
  • net trusts the certificates of a file that it can read, and warns about the others. A UDP host whose name failed to resolve is looked up again on the next send.
  • web's done callbacks run in the order of the requests.
  • Every function says what its parameters and its result are.

What will break

Manifests and native plugins. The plugins use plugin API version 2, as OpenECS 0.5.0 says. They need OpenECS 0.5.0.

Renamed and removed.

  • kind is type in ui's descriptions, the launcher's entries and web.socketReceive.
  • ui.tip is ui.tooltip. ui.focus and ui.tooltip give value<string?>.
  • ui.move, ui.activate, ui.expand, settings.edit and draw.unclip are removed.
  • cglm.project's parameters are named position and viewport.

Building. glslang and SPIRV-Cross are C++, so std's build compiles them with CMake and a C++ compiler, once. A first build takes about 90 seconds more.

Downloads

  • openecs-std-0.5.0-linux-x86_64.tar.gz and openecs-std-0.5.0-windows-x86_64.zip: the plugins built, as above, with the licenses of the libraries in them.
  • openecs-std-0.5.0-source.tar.gz: the source with the libraries it compiles in. Build it inside a checkout of OpenECS, as README.md says.
  • SHA256SUMS: checksums of the archives.

The standard plugins are under the zlib license. The libraries in dependencies/ keep their own licenses, which OpenECS's release lists.

OpenECS-std 0.4.0

OpenECS-std 0.4.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 19 Oct 05:14
610e0ac

OpenECS-std 0.4.0 runs on Windows: every standard plugin builds and passes its tests there. gpu gives a text's glyphs to your own shaders, so a 3D scene can have labels.

It comes out with OpenECS 0.4.0, which ships these plugins built, in its plugins/ folder, for Linux and now Windows. The examples of OpenECS-examples 0.4.0 use them.

What you can do

Use the standard plugins on Windows. They build with LLVM-MinGW or MinGW's gcc, on Windows or as a cross compiler from Linux, and the checks run the examples' tests on Windows.

  • net and web check servers against Windows' trusted root certificates. A file of certificates, such as the one SSL_CERT_FILE names, still comes first.
  • fs watches folders on Windows by reading each watched folder again every half second. It tells what was added, removed, or changed in size or time, as on Linux.

Label a 3D scene. gpu.glyphs(font, text, size) gives the glyphs of a text for your own pipeline. It gives the text's width and line height, and for each texture that holds some of its glyphs, the texture's number, the glyphs' rectangles as vertices, and their indices. A draw with atlas set to that number samples the texture.

Small fixes

  • A plugin's header.h, such as ui's C macros, reaches its definition header on Windows too.
  • Build errors show in the same style as the rest of the build's lines.

What will break

Nothing that plugins use changes.

Downloads

  • openecs-std-0.4.0-source.tar.gz: the source with the libraries it compiles in. Build it inside a checkout of OpenECS, as README.md says.
  • SHA256SUMS: the checksum of the archive.

The standard plugins are under the zlib license. The libraries in dependencies/ keep their own licenses, which OpenECS's release lists.

OpenECS-std 0.3.0

OpenECS-std 0.3.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 19 Oct 05:14
ff06627

OpenECS-std 0.3.0 adds two standard plugins: web, for HTTP, HTTPS and WebSocket connections, and gpu, which draws on the GPU. The plugins of 0.2.0 grow too: ui has trees, tables, tabs, tooltips and number fields, and can be used from C; mixer has streams, panning, filters, an echo and a reverb; gltf reads skins and animations; net speaks TLS; fs watches folders.

It comes out with OpenECS 0.3.0, which ships these plugins built, in its plugins/ folder. The examples of OpenECS-examples 0.3.0 show each new function.

What you can do

Talk to web servers. The new web plugin makes HTTP and HTTPS requests on a thread of its own, so they never block your panels.

  • web.get(url, done) and web.request(method, url, headers, body, done) start a request. done gets it on the main thread once it is done, and request:status(), request:body() and request:header(name) give the answer.
  • web.socket(url) opens a WebSocket connection, to a ws:// or wss:// URL. socket:send, socket:receive, socket:status and socket:close use it, as net's connections are used.
  • HTTPS checks servers against the system's trusted certificates. The setting web.timeout limits how long a request takes.

Draw on the GPU. The new gpu plugin draws into a GPU panel (OpenECS 0.3.0), from Lua or C.

  • clear, fill, line, triangles and mesh draw shapes, as draw does for pixels. mesh blends a colour for each point across its triangles.
  • gpu.texture makes a texture from pixels, which image and imageTransformed draw. It stays on the GPU, so drawing it each frame costs no upload.
  • gpu.text(surface, draw.font("ui"), "Hello", 8, 8, 16, "text") draws text in draw's fonts.
  • For your own shaders: gpu.buffer holds vertices or indices, gpu.shader takes compiled SPIR-V, DXIL or MSL, gpu.pipeline joins two shaders, and gpu.draw draws with them. The draws of a frame share a depth texture.
  • Shapes, text and your pipelines keep the order you draw them in.

Build richer interfaces with ui.

  • New elements: tree, with nodes that open and close; table, with titles that sort and rows that scroll under them; tabs; and number, a field kept between a minimum and a maximum.
  • Any element can have a tooltip.
  • Text fields have a cursor, and select text with Shift, the mouse and Ctrl+A. Ctrl+C, Ctrl+X and Ctrl+V copy, cut and paste, and Ctrl moves by words.
  • Tab and Shift+Tab move the keys from element to element, and Return or Space presses the chosen one.
  • Text with wrap = true breaks into lines at its column's width.
  • ui.rect(panel, id) gives an element's rectangle.
  • ui in C: ui.h has macros in the manner of Clay's, such as UI_COLUMN, UI_BUTTON and UI_FIELD, whose blocks hold their children. A C plugin describes its controls with them, and ui shows them.
  • Each element's props have a type, so your editor completes them.

Play richer sound with mixer and audio.

  • mixer.newStream makes a sound whose samples your plugin gives while it plays.
  • mixer.pan moves a voice between left and right.
  • mixer.filter cuts a voice's sound above or below a frequency, and mixer.echo gives it an echo.
  • mixer.reverb adds a reverb to everything that plays, as in a room.
  • audio.stream plays a long sound file without reading it all first.

Draw, read and write images.

  • draw draws lines and circles with smooth edges, and has rounded and roundedOutline for rectangles with rounded corners.
  • draw.imageTransformed draws an image turned by an angle and tinted by a colour, with smooth edges.
  • image.save writes an image to a PNG, JPG, BMP or TGA file, and draw.imagePixels gives its pixels.
  • image.loadFrames reads the frames of an animated GIF, each with how long it shows.
  • image.decode reads an image from the bytes of its file, such as one inside a model.

Animate models with gltf.

  • gltf.pose gives each node's matrix at a time of an animation.
  • gltf.skin gives the positions of a skinned mesh at a time of an animation.
  • gltf.image gives the bytes of a model's images, also those inside a .glb.

Write terminals with textgrid. Cells can be bold and underlined, and wide characters, such as East Asian scripts and most emoji, take two cells. Resizing wraps the lines again at the new width, and keeps the cursor.

Secure connections with net. net.connectTLS opens a TLS connection, checked against the system's trusted certificates. net.listenTLS waits for TLS connections with a certificate and its key. net.trust trusts the certificates of a file, such as a test server's own.

Follow folders with fs. fs.watch tells your plugin each entry added, removed or changed in a folder. It works on Linux; other systems give nil and a warning.

Use handles as objects. In Lua, each plugin's handles have methods, such as connection:send(data) for net.send(connection, data), and image:size() for draw.imageSize(image).

Go to another tool from any tool. Every tool loads the launcher now. Alt+W, then / opens it.

Small fixes

  • web: a request that cannot start frees what it took.
  • fs: a busy folder never holds the program up.
  • net: TLS that cannot start frees what it made, so a later connection tries again.
  • image: GIF frames that restore the frame before them show right.
  • textgrid: wide characters follow Unicode 15.1, and a line never runs past the grid's edge.
  • ui: text that is not valid UTF-8 no longer raises an error, and numbers show with 14 digits.
  • gltf: a file with fewer skin matrices than joints, or one that asks for more values than memory can hold, no longer reads past its buffers.
  • mixer: a reverb that rings out over silence no longer slows the sound thread.

What will break

The launcher. launcher.open now opens the launcher, as settings.open and panels.open do. launcher.start starts the chosen preset or session, which launcher.open did before.

Downloads

  • openecs-std-0.3.0-source.tar.gz: the source with the libraries it compiles in. Build it inside a checkout of OpenECS, as README.md says.
  • SHA256SUMS: the checksum of the archive.

The standard plugins are under the zlib license. The libraries in dependencies/ keep their own licenses, which OpenECS's release lists.

OpenECS-std 0.2.0

OpenECS-std 0.2.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 19 Oct 05:14
7af7bf3

This is the first release of OpenECS-std, the standard plugins of OpenECS. It comes out with OpenECS 0.2.0, which ships these plugins built, in its plugins/ folder. The examples of OpenECS-examples 0.2.0 show how to use them.

Your plugins build on the standard plugins: name one in your manifest's depends, and get its functions with require in Lua, or from its definition header in C. Each plugin needs nothing but OpenECS. The libraries it uses are compiled into it.

What you can do

Draw and build user interfaces.

  • draw: draws rectangles, outlines, lines, circles, triangles, images and text into your panel, and clips them to a rectangle. It has the interface's font and a monospace one, Roboto Mono, which it ships.
  • ui: buttons, toggles, sliders, selectors, dropdowns, text fields, key fields, images, groups, separators, scroll areas and lists, laid out in rows and columns. You describe them each time the panel draws, and give functions that run on clicks and edits. They are generic, so your tool builds its own views from them, and their sizes are settings.

Plugins that read files are apart from the plugins that use what they read, so a file format is read in one place and works wherever its executor does:

Show text, images and models.

  • textgrid: grids of characters for terminals, consoles, logs and editors, drawn with draw at any font size, with colours and a cursor.
  • image: reads PNG, JPG, GIF, BMP, TGA, PSD, HDR, PNM and SVG files into images that draw draws stretched into your panel. SVG files are read at the size you need, so they stay sharp.
  • gltf: reads glTF 2.0 models, .gltf and .glb, and gives their meshes, materials, nodes and vertex data, which draw's triangles and lines take.

Play sound and talk over the network.

  • mixer: plays sounds, many at once, with a volume and looping.
  • audio: reads WAV, MP3, FLAC and Ogg Vorbis files into sounds that mixer plays.
  • net: TCP connections and servers, and UDP sockets, that never block your program. You ask for what arrived when you want, such as from a timer.

Work with files.

  • fs: lists folders, tells what a path is, makes folders, and copies files. Lua's io reads and writes what files hold, and os renames and removes them.

Change settings, and start a tool.

  • settings: the settings window, on Alt+W, then ,. It lists every setting with a control for its type, and shows a value that does not fit as wrong.
  • panels: the panel list, on Alt+W, then N. It lists the panel types of the tool by plugin, and opens the one you choose.
  • launcher: what OpenECS shows when it starts without a preset: your presets and saved sessions, to open with a click or the keys.

Downloads

  • openecs-std-0.2.0-source.tar.gz: the source with the libraries it compiles in. Build it inside a checkout of OpenECS, as README.md says.
  • SHA256SUMS: the checksum of the archive.

The standard plugins are under the zlib license. The libraries in dependencies/ keep their own licenses, which OpenECS's release lists.