mcclim/mirror.lisp
A McCLIM sheet's relationship with a luv presentation target.
TARGET is initially a native canvas. It is intentionally not part of the mirror's identity: a later target may be a texture presented on a 3D quad.
A luv mirror retaining McCLIM's CPU raster image for later upload.
A direct GPU target for an ordered luv-gpu-medium drawing stream.
An embedded mirror retains an immutable prepared CPU revision for the game's final pass; a standalone mirror renders into its native canvas drawable.
Construct port's renderer-specific mirror for target.
Handle events for a callback-only frame while dispatching native input.
Conventional RUN-FRAME-TOP-LEVEL frames consume their own queues instead.
Drain callback-only input and publish any resulting visual state.
Service callback-only frames without stealing a real frame loop's queue.
The CLIM modifier state for a luv modifiers list.
Lock modifiers (caps lock, num lock) have no CLIM bit and a player with one on is still playing the game, so they contribute nothing rather than fail.
SDL resize events contain dimensions but not an origin. Preserve the native origin McCLIM already knows when constructing its region.
Configuration events are placed ahead of repaint events by McCLIM, so a logical resize is laid out before we redraw for the new pixel extent.
The GPU path has no dirty image to resize, but a new drawable extent still requires McCLIM to rebuild device-coordinate geometry before presentation.
Callback-only demos are torn down by the canvas itself. A conventional frame top level needs the CLIM delete event so its unwind protocol runs.
A compositor may retain a view and descriptor for the old image. Release those dependents before destroying their source.
Present an uploaded McCLIM texture through an optional compositor.
Exhaustively release resources retained by a mirror compositor.
Legacy adapter for the application-neutral release-mirror-compositor.
Prepare compositor for immutable mirror revision outside a render pass.
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.
Upload and present mirror when McCLIM has marked its image dirty.
Acquire the image lock on the native thread. Acquiring it before dispatch would deadlock against native callbacks that draw.
Swapchain creation is sometimes the first point where a Wayland compositor reveals its assigned size. Leave the raster dirty and let McCLIM lay it out before presenting.
realize-mirror's standard :AROUND method normally installs the
direct mirror only after this primary method returns. Geometry
initialization needs it sooner: without a native region the
render medium clips every drawing operation to NOWHERE.
Synchronize McCLIM with whatever logical geometry is observable now. Presentation performs a second reconciliation if Wayland reveals the compositor-assigned extent only at swapchain time.
Resolve the renderer/base-port diamond explicitly. Renderer selection changes the mirror class, not the native host lifecycle.
There is no separate McCLIM top-level loop to provoke the first
exposure. Paint and present before open-widget-lab returns instead
of waiting for the first pointer event to dirty a gadget.
A McCLIM sheet's relationship with a luv presentation target. TARGET is initially a native canvas. It is intentionally not part of the mirror's identity: a later target may be a texture presented on a 3D quad.
Protocol class for objects receiving canvas events.
A MuPDF context: its allocator, its store, and its error stack.
A luv mirror retaining McCLIM's CPU raster image for later upload.
A direct GPU target for an ordered LUV-GPU-MEDIUM drawing stream. An embedded mirror retains an immutable prepared CPU revision for the game's final pass; a standalone mirror renders into its native canvas drawable.
How the children of a list are arranged.
An ordered McCLIM drawing stream containing no software pixel surface.
((call tool-call) stream)(sheet)Logical disjunction of tests and raw truth values.
Logical conjunction of tests and raw truth values.
(port sheet target region)Construct PORT's renderer-specific mirror for TARGET.
Renderer-independent McCLIM display connection owned by luv.
A luv port whose media rasterize into MCCLIM-RENDER images.
A luv port whose media record McCLIM drawing directly as GPU geometry.
(pointer canvas event)A native destination with a lifetime and frame clock.
Addition over compatible quantities.
(sheet)Handle events for a callback-only frame while dispatching native input. Conventional RUN-FRAME-TOP-LEVEL frames consume their own queues instead.
Test whether two compatible scalars are equal.
((sheet sheet) (event shader-lab-health-event))(mirror)Drain callback-only input and publish any resulting visual state.
An explicitly owned AVFrame.
(mirror canvas event class
&key button)(modifiers)The CLIM modifier state for a luv MODIFIERS list. Lock modifiers (caps lock, num lock) have no CLIM bit and a player with one on is still playing the game, so they contribute nothing rather than fail.
(mirror event class)(mirror width height timestamp)(mirror)(provider &optional descriptor)If you're lucky, someone has bound this to a working GPU-PROVIDER.
(canvas gpu-provider &optional configuration)Create a GPU presentation relationship between CANVAS and GPU-PROVIDER. When CONFIGURATION is omitted, return the context unconfigured.
(context)Return CONTEXT's configured drawable extent as (WIDTH HEIGHT), or NIL.
(context configuration)Configure or reconfigure CONTEXT for presentation.
(context)Return the GPU device used by CONTEXT, or NIL before first configuration.
(mirror)(handle)Logically invalidate HANDLE immediately. Native teardown may be deferred until submitted work which captured HANDLE has completed.
(mirror context size)(device descriptor)Asks the DEVICE for a handle to newly created instance of some object fulfilling the DESCRIPTOR.
(compositor)Legacy adapter for the application-neutral RELEASE-MIRROR-COMPOSITOR.
(mirror context texture compositor)Present an uploaded McCLIM TEXTURE through an optional COMPOSITOR.
(context function)(compositor)Exhaustively release resources retained by a mirror COMPOSITOR.
(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.
Logical negation of one test or raw truth value.
(canvas function)Run FUNCTION with a timestamp on CANVAS's native frame/event thread. The initial native implementation is synchronous: the caller waits for the function's values. The protocol leaves room for a real frame scheduler.
(queue destination data data-layout size)Multiplication and scalar scaling.
(mirror)Release renderer-specific resources retained by MIRROR.
A policy object deciding when a canvas should run frames.
((port luv-port) (sheet mirrored-sheet-mixin))(&key (title "luv canvas") (width 800) (height 600)
x y (visible-p t) (fullscreen-p nil)
(high-pixel-density-p nil)
(clock (make-demand-clock))
(time (make-lazy-clock))
(presentation-api :vulkan))Construct an unrealized SDL canvas. WIDTH or HEIGHT may be NIL, which asks the display for a size when the window is finally created.
The maximum of compatible quantities.
(provider)Return the SDL presentation policy required by GPU PROVIDER.
((port luv-port) (sheet mirrored-sheet-mixin))((port luv-gpu-port) (sheet mirrored-sheet-mixin))(&key (server-path '(:luv-gpu))
(title "McCLIM widgets on luv")
target context device)((port luv-port) (sheet mirrored-sheet-mixin))((port luv-port) (sheet mirrored-sheet-mixin) region)((port luv-port) (sheet top-level-sheet-mixin) name)((port luv-port) (sheet top-level-sheet-mixin) icon)((port luv-port) (sheet top-level-sheet-mixin))((port luv-port) (sheet top-level-sheet-mixin))((port luv-port) (sheet top-level-sheet-mixin))((port luv-port) (sheet top-level-sheet-mixin))
Repaint constructs a complete immutable CPU revision, then publishes its pointer under this small lock. A direct compositor materializes that revision into the destination drawable's bounded frame slot; the mirror itself never owns one mutable source buffer shared by in-flight frames.