cotis-pipes
cotis-pipes is the layout-to-renderer pipe for Cotis. It implements LayoutRenderPipe — the conversion layer between cotis-layout output and cotis-defaults render commands.
Status: Early
0.1.0-alpharelease. APIs are still evolving alongside the core Cotis crates.
This repository contains the pipe only. It does not open a window or draw pixels by itself. For a runnable desktop app, combine it with core Cotis crates, a layout manager, and a renderer backend from the ecosystem below.
Architecture
Each frame flows through five stages. This crate owns the pipe stage:
flowchart LR
UI[UI_closure] --> LayoutMgr[CotisLayoutManager]
LayoutMgr --> LayoutOut[RenderCommandOutput]
LayoutOut --> Pipe[cotis-pipes]
Pipe --> Renderer[CotisRenderer]
- A layout manager prepares for the frame.
- UI code builds the element tree through the configurator API.
- The layout manager produces layout output items (
RenderCommandOutput). - This crate transforms those items into renderer commands (
RenderTList<…>). - A renderer draws the command stream.
When layout output already matches what the renderer expects, pass () as the identity pipe instead (see CotisApp::new).
Installation
Add the pipe and required core crates to your Cargo.toml:
= "0.1.0-alpha"
= "0.1.0-alpha"
= "0.1.0-alpha"
= "0.1.0-alpha"
= "0.1.0-alpha"
A full desktop application also needs a renderer. See Quick start and Ecosystem.
Quick start
Clone a renderer backend and run its example:
That example opens a resizable window, lays out UI with cotis-layout and cotis-pipes, and renders through wgpu.
Typical app wiring
use CotisApp;
use CotisLayoutManager;
use CotisLayoutToRenderListPipeForGenerics;
use Dimensions;
use *;
let renderer = auto_start;
let manager = new;
let mut app = new;
while !app.render.window_should_close
Swap cotis-wgpu for cotis-raylib or another backend without changing layout or UI code.
Extending with custom drawables
Append your type to the tail of a RenderTList and implement FromRenderCommandOutput. Return Some(cmd) to emit a draw command or None to skip.
See cotis-layout examples — especially support.rs for a complete StandardRenderCmds alias and circle_example.rs for extending the pipeline with custom drawables.
Ecosystem
Cotis is split across several repositories. This repo provides the layout-to-render pipe; sibling repos provide core traits, layout, and render backends.
| Repository | Role |
|---|---|
cotis |
Core traits and CotisApp orchestration |
cotis-layout |
Flexbox-style layout engine (CotisLayoutManager) |
| cotis-pipes (this repo) | Layout output to render commands (CotisLayoutToRenderListPipeForGenerics) |
cotis-wgpu |
Desktop renderer (wgpu + winit + glyphon) |
cotis-raylib |
Desktop renderer (raylib) |
cotis-renderer-template |
Scaffold for authoring a custom render backend |
cotis-cli |
Plugin host for installable build and run routines |
Pick a renderer backend and swap it without changing layout or UI code. Use cotis-renderer-template to implement a new backend.
Documentation
- API reference:
cargo doc --open - Published docs: cotis-pipes
- Core crate docs: cotis, cotis-layout, cotis-defaults, cotis-utils