mcclim/luvcraft.lisp
Where the widget is in the world. Written once for a widget fixed to a wall, and each frame for one carried in the hand.
A McCLIM surface whose ordered semantic commands enter its final pass.
Embedded mirrors retain dense command buffers rather than a pane-sized raster texture. Solids, analytic paint, images, and Slug text are evaluated at the actual destination pixel.
A direct McCLIM surface mounted in the 3D scene.
A direct McCLIM surface mounted in the presentation HUD.
Return the application attachment format used to encode overlay.
surface-texture is NIL at the pre-pass refresh boundary and the concrete
drawable during replay.
Return the actual texture attachment receiving overlay this frame.
This refresh boundary precedes every game render pass. A widget whose
McCLIM command stream did not change must nevertheless replace stale live
shader pipelines before encode becomes replay-only.
These method coordinates moved from the world-only class to the shared direct compositor. DEFMethod replaces one coordinate but cannot know that an old coordinate has become obsolete in a durable image.
Every command in one retained stream belongs to the same authored
plane, but separate analytic pipelines can round the projected depth in
opposite directions. ALWAYS preserves McCLIM painter order without
coplanar z-fighting; the application orders complete panels far to near.
Return overlay's signed distance along session's camera forward axis.
Publication is itself a preparation boundary. A world widget's final attachment is the floating-point scene target, not its McCLIM canvas; preparing the canvas format here would needlessly replace the scene cohort before the ordinary pre-pass refresh restored it.
Put overlay where display's surface is this frame.
Asked at draw time, because the surface may be a phone in a moving hand; for a wall the answer is the same every frame and costs a few vector ops.
Return center, right, up, and normal clip vectors for overlay's surface.
Return overlay's McCLIM surface size without requiring a backing texture.
Return the opaque game-world housing pipeline for overlay.
The housing is deliberately an application adapter. It is not part of the
shared semantic McCLIM compositor used by luft and other applications.
The physical housing is game geometry; only the CLIM screen itself comes from the retained semantic stream.
Primary methods set this only when they actually draw their backing layer. A hidden inventory or fully retracted metabar must not replay the previous visible frame's text.
Project canvas X,Y through overlay's last rendered screen quadrilateral.
Project into the window's own coordinates rather than the drawable's. A pointer event carries the position SDL reports, which is in logical points; on a dense display the drawable is a multiple of that, and hit-testing a point against a quad projected into pixels misses by exactly the display's scale factor -- which is why no widget overlay could be clicked at all on a Retina Mac.
Pointer positions and this centre probe are both in SDL logical points. The semantic renderer still targets the full drawable extent; mixing those two coordinate spaces here displaced the focus ray on Retina.
Embed enabled McCLIM frame in front of session's current camera.
The frame was enabled before it acquired its world compositor. Repaint once so text is retained for the scene pass but omitted from the backing texture.
Create a McCLIM terminal fixed in front of session's current world camera.
Create and embed a live-world McCLIM surveyor map for session.
Remove and release an open-luvcraft-surveyor-map overlay.
A retained McCLIM command stream replayed into a caller-owned GPU pass. The caller supplies one 4x4 clip-space affine state and the actual destination texture for each frame. Semantic solids, analytic shapes, gradients, images, lattices, and Slug text are evaluated at that texture's native resolution; there is no…
An explicitly owned AVFrame.
A McCLIM surface whose ordered semantic commands enter its final pass. Embedded mirrors retain dense command buffers rather than a pane-sized raster texture. Solids, analytic paint, images, and Slug text are evaluated at the actual destination pixel.
A direct McCLIM surface mounted in the 3D scene.
A direct McCLIM surface mounted in the presentation HUD.
(overlay session surface-texture)Return the application attachment format used to encode OVERLAY. SURFACE-TEXTURE is NIL at the pre-pass refresh boundary and the concrete drawable during replay.
The linear HDR attachment format shared by every scene-stage pipeline.
(overlay session surface-texture)Return the actual texture attachment receiving OVERLAY this frame.
(overlay session)Publish any complete pending render state for OVERLAY at a frame boundary.
(mirror &key
(target-format nil target-format-p)
(depth-stencil nil depth-stencil-p))Prepare MIRROR's compositor for its current immutable GPU revision. Applications call this at their pre-pass refresh boundary even when McCLIM's semantic command stream is unchanged. It deliberately accepts only a direct GPU mirror: raster mirrors have no retained semantic revision and are not a fallback for…
(compositor)Return COMPOSITOR's depth declaration for every semantic pipeline.
(compositor command)Whether COMPOSITOR wants prepared COMMAND in the mirror texture. A compositor which replays a command directly into its final render pass can return false, avoiding a lower-resolution copy underneath the direct draw.
(compositor)Legacy adapter for the application-neutral RELEASE-MIRROR-COMPOSITOR.
(mirror context texture compositor)Present an uploaded McCLIM TEXTURE through an optional COMPOSITOR.
A luv mirror retaining McCLIM's CPU raster image for later upload.
(pass compositor mirror surface-texture clip)(overlay session pass surface-texture)Encode OVERLAY into SESSION's open scene PASS for SURFACE-TEXTURE.
(overlay)Return where OVERLAY draws: :SCENE, :WORLD-PANEL, :VIEWMODEL, :HUD, or :NONE. Scene overlays inhabit world depth; viewmodels are first-person geometry above the world but below held items and the crosshair. World panels retain world projection and depth while drawing analytic application graphics at native…
(overlay session)Return OVERLAY's positive camera-space depth for world-panel ordering. Native-density panels are alpha-composited far to near before their completed depth layer meets the game scene. Non-spatial panel implementations may keep the stable attachment order by returning the default zero depth.
(camera)Addition over compatible quantities.
Multiplication and scalar scaling.
Subtraction or unary negation.
(compositor mirror revision)Prepare COMPOSITOR for immutable MIRROR REVISION outside a render pass.
(compositor mirror revision &key target-format depth-stencil)Prepare COMPOSITOR for REVISION and an application-owned attachment. This target-aware protocol is used when the application renders a retained mirror somewhere other than its canvas format. The default preserves the ordinary revision protocol for compositors without target-specific state.
(overlay display session)Put OVERLAY where DISPLAY's surface is this frame. Asked at draw time, because the surface may be a phone in a moving hand; for a wall the answer is the same every frame and costs a few vector ops.
(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;…
(overlay session width height)(view previous inspection-parameters ink-strength player
&optional (bevel-width luft:+mesh-bevel-width+) (exposure 1.0f0))(x y z)(left right)(overlay)(mirror)(name-and-options lambda-list &body body)Define a function whose complete dynamic extent is an ambient trace zone. The inferred name is PACKAGE/FUNCTION. Use (NAME :ZONE ZONE-NAME) to provide a more semantic name and :VALUE FORM to attach a Tracy work count.
(compositor target-format depth-stencil)(overlay surface-texture)(overlay)Return the opaque game-world housing pipeline for OVERLAY. The housing is deliberately an application adapter. It is not part of the shared semantic McCLIM compositor used by LUFT and other applications.
Logical disjunction of tests and raw truth values.
(device descriptor)Asks the DEVICE for a handle to newly created instance of some object fulfilling the DESCRIPTOR.
(handle)Logically invalidate HANDLE immediately. Native teardown may be deferred until submitted work which captured HANDLE has completed.
(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.
(context)Return CONTEXT's configured drawable extent as (WIDTH HEIGHT), or NIL.
(pass-encoder pipeline)(pass-encoder index bind-group)(pass-encoder vertex-count
&optional (instance-count 1) (first-vertex 0) (first-instance 0))Replay COMPOSITOR's textureless McCLIM mirror into PASS under affine STATE. DESTINATION-TEXTURE describes the open pass for format and clipping. FRAME-TEXTURE names the bounded in-flight presentation slot whose host-visible buffers are safe to update; normally both arguments are the same texture.
(x y a b c)Division of two represented quantities.
Logical conjunction of tests and raw truth values.
Test whether one compatible scalar is at least another.
(weights vertices)Test whether two compatible scalars are equal.
(overlay x y)(state width height u v)A native destination with a lifetime and frame clock.
(event x y)(overlay session canvas event)Handle EVENT projected onto OVERLAY, returning true when consumed.
(session focus)Enter modal interaction with FOCUS, suspending ordinary player input. This is the common session transition behind using a world terminal or book, mounting a vehicle, and other interactions described by #8JCMA5.
(focus session canvas event)Handle EVENT while FOCUS owns SESSION's modal player interaction.
(focus session)Return a non-negative targeting score when FOCUS can be entered by TAB.
(overlay)Release resources owned by an object attached to luvcraft.
(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.
(compositor frame-key)Evict COMPOSITOR's GPU state retained for one canvas FRAME-KEY. The state and all bind groups which borrow its affine buffer are detached before any native resource is destroyed. Other drawable slots remain available.
(origin &rest vector-scales)(session frame &key (distance 4.0) (width 1.8) (right-offset 2.8))(vector scale)(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.
(session &key (title "McCLIM gadget inside luvcraft")
(distance 4.0) (width 1.8) (right-offset 2.8))(&key (server-path '(:luv-gpu))
(title "McCLIM widgets on luv")
target context device)(session &key (title "surveyor map")
(distance 3.2) (width 3.2) (right-offset 0.0))(session &key (server-path '(:luv-gpu)) (title "surveyor map")
target context device)(overlay)(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.
(overlay)
McCLIM command surfaces inside luvcraft. The frame shares the world's native canvas and GPU device; its mirror retains painter-ordered semantic commands and dense buffers which the world or HUD pass replays directly.