luvcraft/terminal-wall.lisp
Return the row-major offset for column,row in domain.
Return COLUMN and ROW for row-major offset in domain.
The styled Ghostty snapshot behind CHARACTERS, or NIL for plain text.
Packed #xRRGGBB foreground and whether the bold face was used.
A terminal cell's colour arrives as a display colour: the byte a shell would have written to a monitor, whose white means "as bright as this screen goes". The scene it is drawn into measures radiance instead, and a lit tube in a daylit room is emphatically brighter than its own diffuse surroundings. These gains are that conversion, and they are also what carries lit glyphs over the presentation bloom threshold, so the glow around bright text is the ordinary lens chain seeing an ordinary bright thing rather than a halo painted onto the terminal.
The multiplier on the font size that fits a display's grid to its face; the default a new display takes.
The frame records screen-right, screen-up, and outward in voxel axes. EQL methods keep the six closed orientations inspectable without making block materials or terminal surfaces branch on their names.
The block at screen-space column zero, row zero (lower left).
These keys are the exact authored chunk materializations whose block content can change membership or exposure. Owner keys are the subset whose visible native meshes carry the display face itself.
A terminal display draws onto *some* rectangle. The wall's rectangle is
a run of blocks (terminal-surface); a phone's is a small plane in the
hand. Everything downstream -- glyph placement, cell backgrounds, the
screen panel and faceplate -- asks the surface only these questions.
Return surface's unit RIGHT, UP, and OUTWARD vectors as three vec3s, in
the coordinate space the surface's display is drawn in.
Return the point offset cell-depths outside surface's lower left corner,
as seen from its outward side.
surface's width along its right axis, in cells.
surface's height along its up axis, in cells.
True when surface's last coherently published derived state is current.
A non-negative score when the display on surface can be entered by TAB,
or NIL. Lower is nearer.
The camera pose from which surface's display is best read, or NIL to
leave the camera where it is with only the narrowed field of view.
Where a panel mounted flat on surface sits in the world this frame.
Returns the panel's centre point, its half-width vector along the surface's
right, its half-height vector pointing *down* the texture, and the outward
unit normal -- all in world space, offset cell-depths off the face. A wall's
answer never changes; a surface carried in the hand answers afresh each
frame, which is why this takes the session and is asked at draw time rather
than once at mounting.
The general surface draws in world space already, so its own axes and corner are the answer.
LUVCRAFT/MCCLIM presentations install their browser here. The terminal remains the focus owner and delegates drawing and events to this child only while its mode calls for it.
The wall's name, which its shell learns as luvcraft_PARENT_SCREEN, and
the portal showing a child luvcraft that asked for that name.
Keyed by (CHARACTER . BOLD-P).
Select display's focused wall mode.
The built-in modes are the EQL-specialized symbols :SHELL and :FILM. LUVCRAFT/MCCLIM adds an :AFTER method which supplies the film browser, while the display continues to own focus and movie lifetime.
A child luvcraft on the wall. The shell on this wall carries the portal server's socket in its environment; a luvcraft started there connects and asks for this wall by name, and its picture takes the wall over until it goes away (Ctrl-C in the shell still reaches the shell, so that is how).
Put the ready child mirror on display's wall and switch it to :PORTAL mode.
The portal panel for display: the whole face, and inside it the picture
of aspect fitted with the same margin the text grid keeps, so the wall's
proportions hold when a shell becomes a portal. Returns the panel's origin,
right edge, and up edge, then the picture rectangle in panel UV.
Take the child off display's wall, if one is there, and go back to the shell.
Selecting Film again while a movie is running returns to its browser.
display's mode child, when the mode is one that presents through it.
:SHELL drives a PTY and owns its own drawing and keys. Every other mode installs a presentation overlay and works through it -- except while a film is actually playing, when the wall is a screen and not a control.
Copy formatted terminal text into one exact dense viewport domain.
Copy a styled Ghostty screen snapshot into one exact viewport domain.
Return foreground #xRRGGBB, background #xRRGGBB or NIL, and bold-p.
Return deterministic fake PTY output for the world display proof.
Discovery is a discover-once frontier program (#K3PCP3): starting from one exposed terminal face, admit coplanar neighbours which are the same material and exposed, mark each once, and retain the admitted component. The compiled realization walks chunk offsets through the world's chunk window; no coordinate objects, hash keys, or conses appear per site.
The per-chunk visited bits owned by one discovery's memo table.
Whether the outward neighbour of CHUNK/OFFSET leaves that face visible.
Exposure probes the outward neighbour through the window; it is only worth asking once the site is terminal material, so it reads lazily.
Discover the coplanar exposed component of material containing X,Y,Z.
Return the retained execution, or NIL and a status when the seed itself is not an exposed terminal face.
Call function with the world X, Y, Z of every retained admitted site.
Discover the maximal exposed rectangular terminal surface at X,Y,Z,face.
Return the surface and :RECTANGLE. A seed which is not terminal, is covered,
or belongs to a non-rectangular coplanar component instead returns NIL and a
descriptive status. Discovery runs the compiled terminal-surface-discovery
program; this function only folds the retained component into a rectangle.
Check surface membership and maximality against authored world content.
A newly adjacent exposed terminal block means this retained rectangle is no longer maximal; its renderer must be rediscovered/rebuilt.
Return the cold set of cells whose content determines surface validity.
Name the authored chunk materializations which justify surface.
Whether each native mesh carrying surface is a current visible product.
Reconcile derived surface state after its native mesh publication boundary.
An authored edit does not immediately alter the retained display. When the surface's visible chunk products are still stale, the old geometry and glyph projection remain one last-known-good cohort.
The edit was outside the chunks this surface observes.
Keep both halves of the old visible cohort until native mesh publication catches up. Revisit on the next frame.
Fit film-aspect inside surface and return its lower-left and edge vectors.
Stop and release display's owned movie, if any.
Play pathname on display's authored wall using the session's video backend.
hardware is the decode policy make-video-screen takes. It defaults to
:REQUIRED, which is right for authored films whose codec is known, and wrong
for a film that arrived from somewhere: whatever a stranger's phone recorded
is not necessarily something this device can decode in hardware, and :AUTO
lets it fall back to software rather than refusing to play.
Return the metric world point offset cell-depths outside the lower left.
Place a width by height terminal-material rectangle in resident world.
ORIGIN is the lower-left block as seen from face's outward side.
Fit domain uniformly inside surface and return scale, left, bottom, width,
and height in world units. font-scale is an explicit multiplier on contain.
One font file and its open loader.
Return linear R G B floats for one packed sRGB #xRRGGBB.
Return one packed sRGB display colour as emission units of scene radiance.
Return the em-normalized line height, advance, and descender.
Place glyphs in one font grid fitted across the entire block surface.
The vertex stage dilates each quad by pixels; this is only the static em padding, normally zero.
The three spare Z lanes carry the linear ink colour.
Build one background record per same-coloured run of cells in a row.
Each record is origin, right edge, up edge, and linear rgb: 12 floats. The
edges span the exact painted rectangle; the shader pads the quad itself and
resolves the analytic edge, so adjacent runs meet without seams.
Sit just below the glyph plane so ink always wins the depth test.
Build the one screen-panel record spanning the whole display surface.
The record shares the cell run's layout: origin, right edge, up edge, then
the outward face normal in the lane the cell run uses for ink. offset names
which of the terminal's coplanar rectangles this is: the default sits just
below the cell backgrounds, so both they and the glyphs win the depth test
against it while it hides the block tiles behind the screen, and the
faceplate's larger offset sits in front of the glyphs instead.
Return glyphs, atlas, glyph instances, and background cell instances.
Keep ordinary shell interaction on one stable atlas. Unicode output grows this retained character set only when a genuinely new character first appears, rather than manufacturing an atlas for every screen.
Solid background quads behind terminal cells, sharing the glyph run's frame bind group so both draw against the same camera uniform.
Build an analytic world-rectangle run of role over 48-byte instances.
The default role draws cell backgrounds; :terminal-screen draws the one
screen panel from make-terminal-display-screen-instances with the same
vertex layout, and :TERMINAL-FACEPLATE draws the glass over the finished
picture from that same rectangle, which is why vertex-role is separable:
two materials can share one placement stage without sharing a name.
Return the glyph run and its companion background cell run.
The wall's shaders are as live as the block world's: a redefined :terminal-screen or :terminal-cell method rebuilds here, at the frame boundary, keeping the last good pipeline on failure.
Clearing before the snapshot preserves an output notification which races after this point; that later notification requests another frame publication instead of being lost.
Unstyled cells take the wall's own ink colour.
The frame uniform buffer display's runs draw against in frame.
A wall draws in world coordinates against the session's own frame uniform. A display whose surface lives in some other space -- a phone in the hand -- supplies a uniform whose camera is expressed in that space instead.
A child game's picture, under this wall's glass like the text.
Film, Telegram, and other presentation-layer modes all draw through the mode's own overlay.
The glass goes on last over shell, browser, or movie: raster, corners, and reflections belong in front of the finished picture.
Presentation modes are child overlays rather than independent session attachments, so propagate capture-target eviction through this owner.
Keys still reach the shell under a portal: that is how the child gets its Ctrl-C.
A screen framed exactly square-on stops being a thing in the world and becomes a pasted screenshot: nothing in the picture reports that the terminal has a plane, a bezel with depth, or a room around it. A few degrees of azimuth and elevation give the frame back its perspective and let the faceplate's reflections and rim curvature actually appear, while staying far short of the angle at which a glyph's stem starts to matter.
--------------------------------------------------------------------- The terminal's knobs.
The emissions and the font scale are baked into each display's glyph
instances, so a display must repopulate to show a change: that is the
terminal-realization, and the knobs carrying it are TERMINAL-KNOBs.
Every terminal display among session's overlays.
Ask every terminal display in session to rebuild its glyphs next frame.
The value is baked into terminal glyph instances; every terminal display must repopulate.
The font scale session's displays use: the first display's, or the
default a new one would take.
The unit direction from a screen's centre toward a viewer standing at
azimuth and elevation degrees off that screen's outward normal.
Return a camera pose which contains surface inside the safe view.
Framing is solved rather than approximated. For an eye at distance D from
the surface centre along EYE-DIRECTION, a corner at offset O from that centre
lands at dot(O, camera-right) * focal / (aspect * (D - dot(O, EYE-DIRECTION)))
across and at the matching quotient down, because the camera's own right and
up axes are perpendicular to its forward axis and so drop out of the depth.
Inverting that for each capacity gives the smallest D at which one corner is
just inside the safe view; the pose takes the largest of the four. With the
focus angles at zero this is exactly the head-on width-and-height solution it
generalizes.
The camera carries no roll, so its own basis follows from the pose it is about to be given rather than from the surface.
Move the eye down the surface just enough to place the terminal in the center of the unobscured view rather than the full frame.
Return the exposed block face through which hit entered its block.
Create and return the wall interaction for the material named name, or NIL.
The material vocabulary is open here the same way it is in the atlas: one EQL method per material which answers activation, so a new display-block material adds a method rather than growing a CASE.
Open the terminal display for the material wall hit names and attach it.
attach receives the fresh display and gives the wall its process; if it
fails, the display is taken down rather than left attached to nothing.
class is the display class to make, for walls that are not shells.
Attach an interactive login-free bash in the checkout to display.
The shell learns where this game's portal server listens and which wall it is on, so a luvcraft started in it appears right here.
The dev shell names its interactive Bash explicitly; outside it,
open-pty-device resolves the fallback through the child environment.
Attach one owned PTY device to display's existing Ghostty terminal.
Choose columns and rows so the font grid fills surface at rows-per-block.
The row count follows the wall's block height; the column count is whatever that cell height affords across the wall's width at the font's own aspect.
Return the columns rows of FONT afford across surface, and rows.
Attach a deterministic Ghostty terminal to an authored block rectangle.
X,Y,Z names any block in the desired exposed face. The maximal coplanar
terminal-material component must be rectangular. Its native block meshes
remain the display body; this overlay contributes only one fitted Slug grid.
When columns or rows is omitted the grid is sized to the wall itself at
rows-per-block rows per block height.
Build a columns by rows Ghostty terminal display of class on surface.
surface is anything answering the terminal-surface protocol: a wall of
blocks or a phone screen. screen-role and faceplate-role name the shader
materials of the panel behind the text and the glass in front of it; the
defaults are the wall's tube. The display is added to session's overlays
unless add-p is false.
ADD consumes DISPLAY on either success or terminal rejection; the local resource variables no longer own it.
(domain)Return the exact number of sites in finite DOMAIN. This deliberately says nothing about coordinate or offset representation. Those mappings belong to concrete domain protocols and are added only when a client needs to traverse them.
Multiplication and scalar scaling.
(domain column row)Logical conjunction of tests and raw truth values.
Test whether one compatible scalar is at most another.
Test whether one compatible scalar is less than another.
Addition over compatible quantities.
(domain offset)Packed sRGB #xRRGGBB used for cells without an explicit foreground.
Radiance per unit of glyph ink, in scene units where diffuse white is one.
Radiance per unit of cell-background colour, held below the ink's own.
The multiplier on the font size that fits a display's grid to its face; the default a new display takes.
(surface)Return SURFACE's unit RIGHT, UP, and OUTWARD vectors as three vec3s, in the coordinate space the surface's display is drawn in.
(surface &optional offset)Return the point OFFSET cell-depths outside SURFACE's lower left corner, as seen from its outward side.
(surface &optional session)True when SURFACE's last coherently published derived state is current.
(surface session)A non-negative score when the display on SURFACE can be entered by TAB, or NIL. Lower is nearer.
(surface session)The camera pose from which SURFACE's display is best read, or NIL to leave the camera where it is with only the narrowed field of view.
(surface session &optional offset)Where a panel mounted flat on SURFACE sits in the world this frame. Returns the panel's centre point, its half-width vector along the surface's right, its half-height vector pointing *down* the texture, and the outward unit normal -- all in world space, OFFSET cell-depths off the face. A wall's answer never changes;…
(origin &rest vector-scales)Division of two represented quantities.
(vector scale)Subtraction or unary negation.
An explicitly owned AVFrame.
(direction)(context)Return CONTEXT's configured drawable extent as (WIDTH HEIGHT), or NIL.
(surface viewport-width viewport-height
&optional (left-inset 0.0) (top-inset 0.0)
(right-inset 0.0) (bottom-inset 0.0))Return a camera pose which contains SURFACE inside the safe view. Framing is solved rather than approximated. For an eye at distance D from the surface centre along EYE-DIRECTION, a corner at offset O from that centre lands at DOT(O, camera-right) * focal / (aspect * (D - DOT(O, EYE-DIRECTION))) across and at the…
(session)(session &key (max-distance +luvcraft-target-reach+))(surface column row)The interactive block world built on luv.
An explicitly owned libghostty-vt terminal.
(display session mode)Select DISPLAY's focused wall MODE. The built-in modes are the EQL-specialized symbols :SHELL and :FILM. LUVCRAFT/MCCLIM adds an :AFTER method which supplies the film browser, while the display continues to own focus and movie lifetime.
(display session)(display)(display mirror)(session &key mirror
(width 640) (height 400)
(distance 6.0) (lift 1.5)
(screen-height 3.0)
rectangle on-stop
(attach-p t)
(frames-per-second 30))Show a child game on a world panel. With no MIRROR, spawn a child of WIDTH x HEIGHT points; otherwise MIRROR is a negotiated, ready one (say, from the portal server). RECTANGLE, when given, is called with the picture's aspect and returns the panel's world origin, right edge, and up edge, and optionally a fourth…
(display aspect)The portal panel for DISPLAY: the whole face, and inside it the picture of ASPECT fitted with the same margin the text grid keeps, so the wall's proportions hold when a shell becomes a portal. Returns the panel's origin, right edge, and up edge, then the picture rectangle in panel UV.
Test whether one compatible scalar is greater than another.
(surface film-aspect)(session portal)(session portal)(display)DISPLAY's mode child, when the mode is one that presents through it. :SHELL drives a PTY and owns its own drawing and keys. Every other mode installs a presentation overlay and works through it -- except while a film is actually playing, when the wall is a screen and not a control.
Logical disjunction of tests and raw truth values.
Test whether two compatible scalars are equal.
(domain text)(domain screen)The minimum of compatible quantities.
(screen column row)(presentation column row)(screen column row)Return the effective foreground and background #xRRGGBB of one cell. Inverse video and the cursor cell swap the two; the second value is NIL when the cell paints no background of its own.
(screen column row)(presentation column row)(content)(x y z)(coordinate direction &optional (amount 1))(x y z)(policy coordinate)(world material coordinate outward absent-neighbor-policy)(samples x y z)Read one world site from a meshing sample source. Return (VALUES BLOCK STATUS) where STATUS is :RESIDENT or :ABSENT. Meshing itself never chooses a representation: the live world, a preresolved chunk neighborhood, and an immutable worker snapshot each answer through their own method, and further sample sources only…
Logical negation of one test or raw truth value.
(block)(name &rest options
&key family frontier-layout neighborhood fields constants predicates
transfer admission priority retain-admissions)(memo chunk)(domain)(window chunk offset outward policy)(domain offset)(domain local-x local-y local-z)(window x y z)Resolve world site X,Y,Z through WINDOW. Return (VALUES MATERIALIZATION OFFSET AVAILABILITY). AVAILABILITY is :AVAILABLE or :UNAVAILABLE; field and subsystem policy must interpret that fact rather than making the spatial protocol call absence air, solid, zero, or open sky. Implementations keep their existing…
(column offset)(name &key declaration lanes read write lazy)(realization)(program &key bindings site-domain (compile t))Close PROGRAM over field BINDINGS and emit its scalar realization. SITE-DOMAIN is a form over MATERIALIZATION yielding the chunk domain that gives a site's dense offset spatial meaning. Each field role of the program must have one FRONTIER-FIELD-BINDING. The laws are parsed and quantity checked against the bound…
(name)Notify retained realizations that program NAME changed.
(world x y z face material absent-neighbor-policy)Discover the coplanar exposed component of MATERIAL containing X,Y,Z. Return the retained execution, or NIL and a status when the seed itself is not an exposed terminal face.
(direction)(realization &key (initial-capacity 256))(realization input frontier)(realization window frontier execution materialization offset value
&rest constants)Seed one site through the program's admission and commit law. For a monotone program VALUE joins the relaxed field; for a discover-once program VALUE is ignored. Return whether the site was admitted.
(realization window frontier execution &rest arguments)Run the compiled program until FRONTIER is empty; return EXECUTION. ARGUMENTS are the program's constants as keywords. A program whose family hands sites to a companion frontier, such as invalidation's surviving sources, takes that frontier as the first argument before the keywords.
(function execution)(world x y z face
&key (material *terminal-block*)
(absent-neighbor-policy :air))Discover the maximal exposed rectangular terminal surface at X,Y,Z,FACE. Return the surface and :RECTANGLE. A seed which is not terminal, is covered, or belongs to a non-rectangular coplanar component instead returns NIL and a descriptive status. Discovery runs the compiled TERMINAL-SURFACE-DISCOVERY program; this…
The maximum of compatible quantities.
(space coordinate)(space x y z)Decompose a world site into chunk and local scalar components. Return CHUNK-X, CHUNK-Y, CHUNK-Z, LOCAL-X, LOCAL-Y, and LOCAL-Z without constructing coordinate objects. Euclidean division keeps every local component non-negative, including for negative world coordinates. This is the dense traversal counterpart of…
(x y z)(world x y z)(surface session)(session key product)(surface &optional session)Reconcile derived SURFACE state after its native mesh publication boundary. An authored edit does not immediately alter the retained display. When the surface's visible chunk products are still stale, the old geometry and glyph projection remain one last-known-good cohort.
(surface direction)The componentwise absolute value of a raw value.
(&body body)(screen)Release SCREEN's pipeline, GPU resources, and open film. Each step is contained so that a failure early on cannot strand the film's decoder or the resources after it; the failures travel out through whatever release report is running. See WITH-RELEASE-REPORT.
(screen)(display pathname &key (hardware :required))Play PATHNAME on DISPLAY's authored wall using the session's video backend. HARDWARE is the decode policy MAKE-VIDEO-SCREEN takes. It defaults to :REQUIRED, which is right for authored films whose codec is known, and wrong for a film that arrived from somewhere: whatever a stranger's phone recorded is not…
(device camera pathname target-format
&key (distance 12.0) (lift 4.0) (height 4.5) rectangle (loop-p t)
(hardware :auto))Open PATHNAME and build a world screen playing it, facing CAMERA. HEIGHT is the screen's height in cells; its width follows the film's aspect. When RECTANGLE is supplied, it is called with that aspect and returns the lower-left origin, right edge, and up edge of an authored world rectangle. HARDWARE is NIL, :AUTO, or…
The linear HDR attachment format shared by every scene-stage pipeline.
(space coordinate)(world origin-x origin-y origin-z face width height
&key (material *terminal-block*))Place a WIDTH by HEIGHT terminal-material rectangle in resident WORLD. ORIGIN is the lower-left block as seen from FACE's outward side.
((world) &body body)(block world x y z)(domain surface font-advance font-height margin font-scale)Fit DOMAIN uniformly inside SURFACE and return scale, left, bottom, width, and height in world units. FONT-SCALE is an explicit multiplier on contain.
(character bold-p glyphs-by-character glyph-cache face)(shaped font-loader cache font-pathname)(cache font-pathname string &key direction)(presentation glyphs-by-character glyph-cache regular bold)Raise a dimensionless value to a dimensionless power.
Extract the unsigned bit field (BYTE SIZE POSITION) of one unsigned scalar.
(packed emission)(font-loader)(occurrences atlas domain surface font-loader margin font-scale)A constant dilation of every glyph quad in em, added on the CPU when the quads are laid out. Zero leaves the work to the per-vertex dilation; the value luv used before dynamic dilation was 0.035.
(presentation surface font-loader margin font-scale)Build one background record per same-coloured run of cells in a row. Each record is origin, right edge, up edge, and linear RGB: 12 floats. The edges span the exact painted rectangle; the shader pads the quad itself and resolves the analytic edge, so adjacent runs meet without seams.
(surface &optional (offset 0.003))Build the one screen-panel record spanning the whole display surface. The record shares the cell run's layout: origin, right edge, up edge, then the outward face normal in the lane the cell run uses for ink. OFFSET names which of the terminal's coplanar rectangles this is: the default sits just below the cell…
(presentation surface glyph-cache glyphs-by-character
font-pathname bold-font-pathname margin font-scale)(cache glyphs)Solid background quads behind terminal cells, sharing the glyph run's frame bind group so both draw against the same camera uniform.
(session glyph-run instances
&key (role :terminal-cell)
(vertex-role role)
(label "terminal cell backgrounds"))Build an analytic world-rectangle run of ROLE over 48-byte instances. The default ROLE draws cell backgrounds; :TERMINAL-SCREEN draws the one screen panel from MAKE-TERMINAL-DISPLAY-SCREEN-INSTANCES with the same vertex layout, and :TERMINAL-FACEPLATE draws the glass over the finished picture from that same…
(terminal)(device descriptor)Asks the DEVICE for a handle to newly created instance of some object fulfilling the DESCRIPTOR.
(&key role (stage :fragment) vertex-role label device layout vertex-module
vertex-buffers target-format target-blend primitive depth-stencil)Create and install a live mathematical render pipeline. VERTEX-MODULE is borrowed when VERTEX-ROLE is NIL and STAGE is not :VERTEX. Every module compiled from ROLE or VERTEX-ROLE is owned by the returned artifact and retired on replacement or explicit release.
(artifact)(handle)Logically invalidate HANDLE immediately. Native teardown may be deferred until submitted work which captured HANDLE has completed.
(run device instances)(arguments)(session presentation surface glyph-cache glyphs-by-character
font-pathname bold-font-pathname margin font-scale)(device target-format string font-pathname shaped glyphs atlas center
world-units-per-em instance-data &key (label "world HarfBuzz Slug text"))Create one owned Slug draw batch from caller-positioned GLYPHS. The caller owns the semantic placement policy and supplies the dense instance records. This is the shared GPU boundary for ordinary shaped runs and the unified terminal surface in #7ZM22R.
(overlay)The live shader pipelines OVERLAY owns, so the session can count them among its own; none by default.
(name-and-options &rest method-tail)Define a method whose complete dynamic extent is an ambient trace zone. The inferred name includes the generic function, non-T required specializers, and qualifiers. :ZONE and :VALUE have the same meaning as in ZDEFUN.
(overlay session)Publish any complete pending render state for OVERLAY at a frame boundary.
(artifact)(device function)(screen)(run device string glyphs atlas instance-data)Publish one complete replacement instance population into RUN. The caller owns the semantic candidate. This function creates and fills its new GPU buffer before installing the new string, glyph, atlas, CPU-data, and buffer cohort. Native destruction of the predecessor remains submission-aware through the backend's…
(display frame)The frame uniform buffer DISPLAY's runs draw against in FRAME. A wall draws in world coordinates against the session's own frame uniform. A display whose surface lives in some other space -- a phone in the hand -- supplies a uniform whose camera is expressed in that space instead.
(display frame)(run device uniform-buffer)(overlay session pass surface-texture)Encode OVERLAY into SESSION's open scene PASS for SURFACE-TEXTURE.
(pass-encoder pipeline)(pass-encoder slot buffer &key (offset 0))(pass-encoder index bind-group)(pass-encoder vertex-count
&optional (instance-count 1) (first-vertex 0) (first-instance 0))(portal session pass surface-texture)Draw PORTAL's panel into the open scene PASS. Overlays that own a portal (the terminal wall) call this from their own drawing so their glass goes on top; a free portal is an overlay itself and calls it from ENCODE-LUVCRAFT-OVERLAY.
(overlay)Release resources owned by an object attached to luvcraft.
(device &key (timeout 2.0))(terminal)(overlay frame-key)Evict OVERLAY resources retained for one canvas FRAME-KEY. Offscreen captures use a fresh target, so an overlay which caches per-frame GPU state must detach that entry before the shared capture target is destroyed.
(focus session canvas event)Handle EVENT while FOCUS owns SESSION's modal player interaction.
A native destination with a lifetime and frame clock.
A portable physical-key event with logical modifiers and layout text.
(device event)(overlay session canvas event)Handle EVENT projected onto OVERLAY, returning true when consumed.
(focus session canvas event)Offer EVENT to controls which belong to focused FOCUS, returning true when consumed. This is narrower than the ordinary overlay event path: a focused world object may expose a HUD control without allowing an unconsumed click to fall through to block editing or to unrelated overlays.
(focus session)Return a non-negative targeting score when FOCUS can be entered by TAB.
Degrees the focused view stands to the side of the screen's own normal.
Degrees the focused view stands above the screen's own centre.
The value is baked into terminal glyph instances; every terminal display must repopulate.
(session)(session)(knob session)Do what SESSION needs after KNOB's value changed for the change to show. The primary method on KNOB does nothing: a value the renderer reads every frame is realized by the next frame. A realization mixin adds a method.
One live value: where it lives, what it measures, and -- by its class -- what SESSION must do after a change for the change to show.
A knob over a real, bounded and quantized.
(session)The font scale SESSION's displays use: the first display's, or the default a new one would take.
(name (&key label (group :grading) documentation
(class ''scalar-knob)
quantity (type 'single-float)
unit-label minimum maximum step)
place)Define NAME as a knob of CLASS over the setf-able PLACE. PLACE may refer to SESSION, so a knob can live on the session -- its sky clock, its player -- as well as in a special. QUANTITY is a quantity plist as DEFINE-QUANTITY-CONSTANT takes, (:quantity ... :unit ...); it and TYPE make the knob's declaration, which…
(right up outward azimuth elevation)The unit direction from a screen's centre toward a viewer standing at AZIMUTH and ELEVATION degrees off that screen's outward normal.
(vector)The inner product of two vectors.
The 50-degree vertical field of view used during modal focus.
(left right)(focus session)Return FOCUS's desired CAMERA-POSE in SESSION, or NIL for an FOV-only cue.
(block session hit)Create and return a focusable interaction for targeted BLOCK, or NIL.
(name session hit)Create and return the wall interaction for the material named NAME, or NIL. The material vocabulary is open here the same way it is in the atlas: one EQL method per material which answers activation, so a new display-block material adds a method rather than growing a CASE.
(session hit material attach
&key (class 'terminal-display))Open the terminal display for the MATERIAL wall HIT names and ATTACH it. ATTACH receives the fresh display and gives the wall its process; if it fails, the display is taken down rather than left attached to nothing. CLASS is the display class to make, for walls that are not shells.
(session x y z face
&key columns rows
(rows-per-block 6)
(fixture (terminal-display-fixture))
(material *terminal-block*)
(class 'terminal-display)
(margin 0.12)
(font-scale 1.0)
(font-pathname *terminal-display-font-pathname*)
(bold-font-pathname *terminal-display-bold-font-pathname*)
(default-foreground *terminal-display-default-foreground*))Attach a deterministic Ghostty terminal to an authored block rectangle. X,Y,Z names any block in the desired exposed FACE. The maximal coplanar terminal-material component must be rectangular. Its native block meshes remain the display body; this overlay contributes only one fitted Slug grid. When COLUMNS or ROWS…
(session overlay &key (release-p t))Detach OVERLAY at a frame boundary and optionally release it there. The no-release path is intentionally preserved for FUSE-LUVCRAFT-OVERLAY: that path may run inside a frame whose command stream still borrows OVERLAY.
(display)Attach an interactive login-free bash in the checkout to DISPLAY. The shell learns where this game's portal server listens and which wall it is on, so a luvcraft started in it appears right here.
(display &rest open-arguments)(terminal &key
(program (or (uiop:getenv "SHELL") "/bin/sh"))
arguments directory environment
(term "xterm-256color") on-output)Start PROGRAM under a PTY whose output drives TERMINAL. The device owns its child, PTY stream, IO thread, and Ghostty response route; it does not own TERMINAL. All terminal mutation and PTY traffic are serialized by the device's worker. Use CALL-WITH-PTY-DEVICE-TERMINAL for renderer-side snapshot work which must…
(surface font-pathname margin rows-per-block)Choose columns and rows so the font grid fills SURFACE at ROWS-PER-BLOCK. The row count follows the wall's block height; the column count is whatever that cell height affords across the wall's width at the font's own aspect.
(surface font-pathname margin rows)(session surface columns rows
&key (class 'terminal-display)
(fixture (terminal-display-fixture))
(margin 0.12)
(font-scale 1.0)
(font-pathname *terminal-display-font-pathname*)
(bold-font-pathname *terminal-display-bold-font-pathname*)
(default-foreground *terminal-display-default-foreground*)
(screen-role :terminal-screen)
(faceplate-role :terminal-faceplate)
(add-p t))Build a COLUMNS by ROWS Ghostty terminal display of CLASS on SURFACE. SURFACE is anything answering the terminal-surface protocol: a wall of blocks or a phone screen. SCREEN-ROLE and FACEPLATE-ROLE name the shader materials of the panel behind the text and the glass in front of it; the defaults are the wall's tube. …
(&key (columns 80) (rows 24))(terminal text)(device)(session overlay)Attach OVERLAY at SESSION's next native frame boundary and return it. ADD consumes a newly offered OVERLAY on both success and terminal rejection. Once SESSION begins stopping, the rejected overlay is released exactly once before APPLICATION-ATTACHMENT-CLOSED is signalled.
A planar rectangle of adjacent terminal-material blocks is a useful discover-once client. Starting from a placed or changed block face, the pass can traverse coplanar face neighbors of the same material, reserve a candidate surface identity, and collect bounds and membership. It then validates that the bounding…
A Ghostty terminal projected across a rectangle of authored world blocks.