Commit Graph
455 Commits
Author SHA1 Message Date
waozi b6f35a7408 Document Android's linked picture codecs
Android decodes PNG, WebP and AVIF in process with the linked codecs; other
formats use the activity's decodeBundleImage bridge, and
`make android-pictures-device-test` checks both on the USB Moto.
2026-11-18 14:22:39 -03:00
waozi ac6c8f47b8 Add VRM 0.x avatars: humanoid map, expressions, lookAt and spring bones
scene_vrm reads the VRM extension of a .vrm/.glb loaded through scene_gltf:
the humanoid bone map, blend shape expressions (blink and the rest) set as
morph weights, Bone lookAt through its range curves, and VRM 0.x spring
bones with sphere colliders. Springs follow UniVRM's VRMSpringBone (Verlet
inertia less drag, stiffness back to rest, gravity, length kept, pushed out
of colliders), step at a fixed 60 Hz in the world placed by VrmSetFrame so
whole-body motion swings the hair, and settle at rest after a seek. Node
positions come from the instance TRS, so one GltfUpdateScene a frame is
enough.

make scene-gltf-test also runs the VRM checks from source and saved IR
against a small fixture: bone map, expressions, lookAt curves, gravity,
colliders, stability at uneven frame steps while the body moves, settling.
2026-11-18 13:10:37 -03:00
waozi 0ad6f6cf07 Load glTF 2.0 models into scene meshes and skins
Read .gltf and .glb documents in Ziran: buffers, bounds-checked accessors
for every component type with normalized integers and sparse overrides,
triangle primitives with the standard vertex attributes and morph
targets, node hierarchies, skins and LINEAR, STEP and CUBICSPLINE
animations. Materials keep PBR factors, texture info, alpha modes and
PNG or JPEG images from URIs, data: URIs or bufferViews.

The scene adapter creates one indexed mesh per primitive and a SceneSkin
per skinned primitive, samples animations into node poses and morph
weights, and can switch to dual-quaternion skinning. Malformed files
report a diagnostic instead of crashing.

Tests cover the small fixtures, every interpolation mode, sparse and
normalized accessors, malformed files, and a headless GLES render of an
animated two-bone skin against a committed reference. The Khronos sample
models committed here are CC-BY-4.0 or CC0-1.0 with their attribution.
2026-11-18 11:33:54 -03:00
waozi e74f080498 Benchmark and accelerate Kryon shader workloads 2026-11-18 02:43:52 -03:00
waozi 1ed9695e52 Keep full GPU shadow filtering without hardware PCF
Use nearest depth textures and interpolate the comparison results in the material shader when the hardware probe fails. Exercise CPU parity and shadow rendering with both paths.
2026-11-18 01:37:05 -03:00
waozi 4b79d97615 Retain smooth indexed scene geometry on GLES
Upload only changed vertex streams during deformation and keep material texture uploads on their assigned sampler units.
2026-11-18 01:33:24 -03:00
waozi 9c8240a73f Give terminal-style desktop apps the services they used raylib for
The SDL2/Cairo desktop host gains what kryonlabs/terminal and Harmony's
terminal need to leave kryon/Raylib:

- kryon/desktop_activity: DesktopWaitForActivity(descriptors, ms) sleeps
  until a program descriptor such as a PTY is readable, window input is
  queued, or the time ends, leaving queued input for PollDesktop. Windows,
  web and Android report DesktopActivityUnsupported.
- OpenDesktopWindow(width, height, title, options) with resizable,
  undecorated, topmost and always-run windows; OpenDesktopTitled stays the
  resizable window.
- DesktopFrameRate(fps) paces the frame clock, 0 drawing without waiting;
  a stable screen never settles faster than the configured rate.
- DesktopExitKey(key), PollMiddlePointer(), DesktopSetFullscreen,
  DesktopToggleFullscreen, DesktopFullscreen and DesktopPrepareGlyphs.

tests/ziran_desktop_host_gaps_test.sh covers each on a private Xvfb, from
source and saved IR.
2026-11-17 22:29:37 -03:00
waoziandClaude Opus 5.5 4923381c88 Load the pictures an Android app ships from its APK on first use
Android Frame apps draw through Pixmap, which found only pictures already
registered, so every file picture showed "Missing image". Pixmap now asks
an optional picture source the first time it measures or draws an
unregistered path, once per missing path until invalidation or host
cleanup. pixmap_assets_android registers a source that reads the APK asset
through AAssetManager and decodes it, and the Frame host imports it, as
desktop Cairo loads pictures on first use.

Tests: the Android image services test covers lazy loading, caching, the
single lookup per missing path, retry after invalidation and cleanup. A
new device suite decodes a framework PNG through Android's real
AssetManager inside its VM and compares it with an independent decode;
tests/android_vm_device_test.py now runs it and the typeface suite. Frame
host tests link the codecs that apps link.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 17:23:44 -03:00
waozi da7f5755b1 Write assets given as bytes to temporary files on Windows
Fonts registered from bytes and pictures from a program's asset reader
became Linux in-memory files opened through /proc/self/fd, which MinGW
cannot link. cairo_assets now takes its files from asset_files_linux
(memfd, as before) or asset_files_windows, which writes each asset to a
file of its own in the user's temporary folder by an ASCII path and
removes it when it is closed or when the program exits.

windows_desktop_test.py runs a new Wine program, linked with -lws2_32,
that draws text in a font given as bytes, decodes a picture given as
bytes, calls Winsock's connect beside the image decoders, and leaves no
temporary files behind.

Local tests: the whole Windows desktop suite passes under Wine on a
private display, and the Linux desktop windows test still reads
embedded pictures and fonts from in-memory files.
2026-11-17 17:11:38 -03:00
waozi bda9e9d9a2 Add skinned scene surfaces and a portable watercolor material
kryon/scene_skin gives scenes indexed surfaces with four-influence
skinning that always deforms from bind data. kryon/watercolor samples real
paper and pigment bitmaps with soft light and a Fresnel rim, and its
finishing pass adds brush regions, paper grain, pigment pooling and pencil
contours while keeping alpha exact. Both run on the CPU renderer and the
translated GLES path. Desktop LoadImagePixels accepts an optional host path
resolver so bundled assets decode like disk images.
2026-11-17 16:49:39 -03:00
waozi 34f26c2523 Fix scene GPU linking for Android API 21
Use Android's default EGL display and preserve its current context without
importing desktop GLX or newer EGL platform entry points. Link EGL and GLESv3
through the shared Android CMake helper.

Add strict API21 NativeActivity link coverage for both ARM ABIs, rejecting
GLX/newer EGL symbols and requiring the real Android/EGL entry points.
Document the Android generation and link requirements.

Local tests: both-ABI NativeActivity links passed; build-queue -- make push-check
passed, including desktop host, gamepad, text-hook and pixmap GPU coverage.
2026-11-17 15:27:32 -03:00
waozi 455c364e76 Export the image placement rules apart from file pictures
kryon/image brings file pictures since 15c3a22e, so a program that
imports it links a host's ImageWidth and ImageHeight. Jungle's story
layout test uses only ImageFitBounds and ImagePreviewSource and no
longer linked. Export image_behavior for code that needs only the rules.

Local tests: a package consumer using kryon/image_behavior links and runs
without a host; the same program with kryon/image reproduces the
undefined ImageWidth and ImageHeight.
2026-11-17 14:46:23 -03:00
waoziandClaude Opus 5.5 e05146b3ba Host Android apps that run their own frame loop
kryon/android_runtime keeps NativeActivity lifecycle and input in the host
while the application's main owns its loop, widgets and pacing:
PollAndroidHost, BeginAndroidFrame and EndAndroidFrame present Pixmap's
device-pixel damage. The host calls the application's C main by symbol, so
generated C never declares main with Ziran's argument types. Pixmap's
RasterSetTransform and RasterPointFromPixels share one camera for painting
and input.

kryon/pixmap_assets_android decodes owned PNG, WebP and AVIF pictures on
first use, and kryon/pixmap_typefaces_android shapes text with Android Paint
and Canvas through the ordinary typeface_source capabilities.

The renderer-desktop artifact also builds Android ARMv7 and AArch64 codec
archives and the shared AVIF bridge, pinned to AVIF 2611e727.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 13:30:41 -03:00
waozi 0a86415bff Apply a followed palette to the active theme too
SystemPaletteApply installs a system palette as style rules and as the
active theme's colours, so code that draws from CurrentPalette() matches
the host as well as styled widgets. SystemPaletteUpdate applies a palette
only when it changed; SystemPaletteFollow in SystemThemeHostLinux and in
the portable SystemThemeHost feeds it each frame, so ZX apps such as
Harmony's Telegram follow a host's theme change with one call.

The parent-theme test checks CurrentPalette() after a followed change.
2026-11-17 11:43:53 -03:00
waozi 13ff9478a3 Expand a host's palette into a full theme palette
SystemTheme.SystemPaletteColors(palette) builds a complete theme Palette
from a system palette such as the one Harmony gives an embedded app: its
background, surface, text, accent and border, and surfaces, text levels,
borders, selection and controls mixed from them, so an app that draws
from a theme palette matches its host completely.

The parent-theme test checks the expanded palette after a host change.
2026-11-17 11:29:23 -03:00
waozi 81e337a6e0 Let embedded apps follow their host's theme with one call
SystemThemeHostLinux.SystemPaletteFollow() installs the current palette,
the host's while an app is embedded, the first time and again whenever
the host changes it, and returns true when it installed. An app that calls
it once per frame follows a theme change in Harmony's Sessions window
without colour code of its own.

The parent-theme test gains a follow scenario: one install, none while
unchanged, and one after each host change. Both theme tests now link libm,
which the style sheet code needs.
2026-11-17 11:17:35 -03:00
waozi a4817c9907 Use core Ziran audio for desktop and Android media playback
Use the platform-selected asynchronous std audio sink and core mixer,
remove the six moved Kryon audio modules and exports, and select their
published compiler and optional Opus package pins. Add actual Moto UI
PCM source/saved validation and retain deterministic device-failure tests.

Local tests: desktop PCM/MP3/Vorbis, Windows Wine host and audio,
Moto source/saved UI PCM, ziran check and push-check passed. The full
shared-tree test stopped at the separately owned Canvas program-entry
title/boot test; this commit has no program-entry or title changes.
2026-11-17 11:06:45 -03:00
waozi a814f67710 Document and test headless image dimension bindings 2026-11-17 00:36:25 -03:00
waozi 028d42cb15 Provide native frame snapshots and desktop image services
Add exact/folder/all picture cache invalidation, shared oriented preview
pixels, and owned previous-frame snapshots for desktop and NativeActivity.
Keep alpha and row orientation through Image transitions, including negative
camera origins. Capture desktop frames after presentation and preserve Android
pixels until the route finishes composing. Web returns an invalid snapshot.

Local tests cover source/saved desktop and Android pixels, Windows/Wine
snapshots, native image previews, Canvas browser/Wasm, Android NDK host links,
frame transition behavior, bitmap ownership, and push-check.

Known upstream gap: published Ziran ebd19223 rejects the portable bitmap Image
test in PixmapGpuCorners with assembly.gap.machine-copy. Reproduced unchanged
on origin/master 216c190c: function 300, block 5978, instruction 27407.
The native C control passes. See plans/2026-11-16-remove-raylib.md.
2026-11-16 22:36:04 -03:00
waozi 216c190c43 Document only current Kryon APIs and website pages
Remove raylib paths, obsolete import and preview guidance, migration prose,
and orphaned documents/pages. Align widget imports, native ZX windows and
host contracts with the current implementation, and enforce current site routes.
2026-11-16 21:43:18 -03:00
waozi 0f5c68e162 Let Escape dismiss modals independently of outside clicks
Keep outside releases blocked by default while allowing Escape to close the top modal. Preserve dismiss_disabled as the explicit override for both routes, including through the portable widget host.
2026-11-16 21:40:47 -03:00
waozi 9052a642a0 Apply desktop camera offsets to Cairo painting and pixel snapping 2026-11-16 21:03:44 -03:00
waozi 66a11957b4 Use native desktop and Android hosts for window runtime 2026-11-16 20:50:54 -03:00
waozi 0c6f138e31 Show a program's ZX window in the browser through the canvas player
A program entry (one that declares main) was refused in any profile but
codegen c99, so window.zi's ZX could not run in a page. A codegen = "zx"
profile now bundles the program's own main with portable IR, which
kryon/app gives the zx_window window; no generated program host is made.

In the page the ZX canvas player runs such a bundle through
window_page_player.zi: it binds zx_window's five capabilities to the page's
canvas with page_core, as page_window does for a C program, lowers the
bundle to Wasm in the page and runs main until the page closes. Each wait
for an event sleeps, which yields to the page, so the program's own loop
never blocks it. zx_window_bundle.zi holds the capability check both
players use. The editor's Wasm platform opens window.zi this way, and its
browser test checks that the page's canvas is cleared to the frame colour.
2026-11-16 19:47:52 -03:00
waozi f10e551f6c Ship the desktop window as a host library zx2native links
window.zi's bundle asks its host for five zx_window capabilities. The
desktop zx player binds them in-process for `ziran run`, but a native
executable from zx2native had no host to call, so the editor's Native
Assembly and Binary stopped at assembly.gap.machine-host.

zx_window_host.zi exports the five capabilities with the C ABI the C
target gives zx_window's declarations, over the same desktop_window SDL
window. `make zx-window-host` builds build/lib/libkryon-desktop.so from it
alone, and `make install-user` installs it to ~/.local/lib/kryon and
registers ~/.local/share/ziran/hosts/kryon-desktop.library, so zx2native
links window.zx into a Linux executable that opens its 320x160 "Window"
in the empty frame's colour and exits 0 when it closes.

zx_window_test runs both routes on a private Xvfb, the player through
`ziran run` and the executable directly, and checks that with no library
registered zx2native stops at the gap naming ZxWindowOpenHost.
2026-11-16 19:47:52 -03:00
waozi 77184e46c5 Export shared Markdown preview and editor
Expose byte-preserving Markdown formatting and TextArea composition as optional
package imports for Breeze Diary. Wire native and portable editor behavior
coverage into make test and test-focus, and document the public surface.

Signed-off-by: Waozi <[email protected]>
2026-11-16 16:38:49 -03:00
waozi 6425728b02 Give embedded apps their host's theme by default
An app that Harmony embeds now draws in Harmony's theme without code of
its own. SystemThemeLinux.SystemPaletteRead returns the palette the host
keeps on the window it embeds the app in, after checking that the named
host is the app's parent and owns that window, and reads it again on each
call so an app that reads it follows a theme change. Started on its own,
an app gets the desktop's GTK palette as before.

The reader moves out of SystemThemeHostLinux into ParentThemeLinux, which
SystemThemeHostLinux now reuses. It loads libX11 at run time and only when
a host is named, so apps that are never embedded, and Windows, Android and
web builds, need no X11.

A Ziran test plays the host on a private X display: the hosted palette is
returned and followed, an unknown version is ignored, and a host that is
not the app's parent gives no theme.
2026-11-16 11:34:44 -03:00
waoziandClaude Opus 5.5 ac209b9ea7 Give hosted bundles kryon/menu's props, types and state alone
menu.zi imported the retained tree, tree input and paint queue
unconditionally, so a KRYON_HOSTED_UI bundle that imports kryon/menu
for its MenuItem, MenuGroup, Props and MenuState failed on TreeNextKey,
TreePrevious and the rest. The retained menu bar now sits in the
non-hosted branch; a hosted bundle carries only menu_props.

pay-per-import-test bundles a hosted program using the menu's types
and checks it carries exactly its own module and menu_props and asks
its host for nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 04:16:51 -03:00
waozi 4e5de9fef1 Stream Ogg Vorbis through the desktop mixer
audio_decode_vorbis adds Ogg Vorbis to audio_mixer by import, streamed at
the stream's own rate through audio/vorbis, which audio ce5837f8 adds over a
pinned stb_vorbis; Kryon now pins that audio commit. make builds the audio
package's libziran_vorbis.a for the programs that link it.
tests/desktop_audio_vorbis_test.zi checks the mixer's frames against
audio/vorbis's own decode of the package's fixtures, a 22.05 kHz stream's
length at 48 kHz, and a Vorbis clip through Kryon's asset audio.
2026-11-16 03:03:19 -03:00
waozi f4cd71a580 Open App.Show's window from a portable bundle
A ZX build of kryon/app shows its window through zx_window: five host
capabilities (open, next event, clear, present, close) and the bundle's
own loop until the window closes. window.zi's bundle is window, app and
zx_window, with no frame, font or text code. The desktop zx player binds
those capabilities to desktop_window, now split into the same SDL steps,
and runs the bundle's main as native code with no engine fallback, so
`ziran run window.zx` opens one 320x160 "Window" in the empty frame's
colour and exits 0 when it closes.

make zx-window-test checks that on a private Xvfb; make
pay-per-import-test checks the bundle's exact modules and host
capabilities and its checked program.
2026-11-16 02:50:22 -03:00
waozi 28424a846d Let portable apps show pictures they make at run time
A zx bundle's kryon/bitmap_image now asks its player to create, update and
release the picture (kryon build defines KRYON_ZX for zx profiles), and the
desktop zx player keeps it in its own bitmap store for the session it runs,
so its raster draws it like any other image. Before, a bundle's runtime
texture was unknown to the player and the frame failed.
2026-11-16 02:40:58 -03:00
waozi 069f4c6c26 Stream MP3 through the desktop mixer
audio_decode_mp3 adds MP3 and MPEG Layer I and II audio to audio_mixer by
import, streamed at the stream's own rate through audio/mp3, which audio
5ea3f6f1 adds over a pinned dr_mp3; Kryon now pins that audio commit. make
builds the audio package's libziran_mp3.a for the programs that link it.
A stream's last frame now plays before it finishes.
tests/desktop_audio_mp3_test.zi checks the mixer's frames against
audio/mp3's own decode of the package's fixtures, a 44.1 kHz stream's
length at 48 kHz, and an MP3 asset through Kryon's asset audio.
2026-11-16 02:16:41 -03:00
waozi 0dea8bc28b Mix and play audio on the desktop host without raylib
audio_mixer mixes sounds decoded whole, music decoded while it plays and
PCM streams into 48 kHz float32 stereo, with gain, pitch, loops, pause and
a tap on every mixed block. audio_sink_sdl plays it from SDL2's audio
thread; audio_decode_opus (streamed through audio/opus) and audio_decode_wav
add formats by import; media_audio_desktop runs kryon/media_audio on it.
tests/desktop_audio_test.zi renders into its own buffer and plays through
SDL's disk driver, with no audio device.
2026-11-16 01:30:57 -03:00
waozi 1b8e50bc5b Run an app's own windows, input and raster on the desktop host
The Linux desktop host routes each SDL event to the window it names and
reports the sideways wheel. New optional modules, each linked only by the
programs that import it: desktop_keyboard (held, pressed, repeated and
released keys), desktop_window_state (minimize, maximize, restore, raise,
always on top, monitor bounds and display scale), desktop_secondary_window
(more windows with their own Cairo surface, presenter and events, with the
raylib_secondary_window calls), and cairo_assets (embedded pictures decoded
from memory), cairo_typefaces (typeface_source on Pango and fontconfig) and
cairo_render_scale. tests/desktop_windows_test.zi drives them on a private
Xvfb with XTest input.
2026-11-16 01:30:27 -03:00
waoziandClaude Opus 5.5 15c3a22e43 Bring pictures, text input and scroll devices only with the widgets that use them
The desktop rasterizer loads, decodes and smooth-copies file pictures once
a program first asks a picture's size, which every widget that draws one
does first, so vector icons and managed pixels draw without decoders,
threads or asset paths. LanczosSnap is geometry's RectangleSnap, so a
texture draw no longer reaches the Lanczos cache.

A button reaches file pictures and atlas icons through the new
image_lookup. kryon/image is now image_files, which re-exports the Image
widget (image) and fills the pictures; kryon/icon fills the atlas. Library
code imports image itself, so importing a picture-capable widget registers
nothing. Navigation, copy and confirm buttons and the widget host fill the
lookup where they draw, as they reached pictures before. Props modules that
only name Image.Props import image_props, now also exported; unused image
imports are gone.

The frame and the accessibility host reach text requests and editor focus
through text_editing, which text_request and text_input_platform fill, and
the frame samples scrolls through scroll_sampling, which scroll_device
fills.

Desktop examples (C files, C bytes, executable), before -> after:
button 96, 1 411 582, 448 264 -> 70, 980 794, 342 016
text 95, 1 445 077, 462 504 -> 71, 1 020 207, 356 472
textfield 107, 1 580 157, 514 496 -> 84, 1 166 840, 409 840
make pay-per-import-test checks button and textfield; tests whose programs
no longer reach pictures lose their picture bindings and stubs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 23:10:23 -03:00
waozi b223f2c1cc Keep a bare window's checked program to the window
kryon/app imports each platform's window (desktop_window, the new
page_window) and frame loop (frames_desktop, frames_web) as separate
modules. A program that only calls App.Show now checks seven modules on
Linux instead of ten: no session, geometry, desktop runtime or frame host.
desktop_window takes the SDL event from the new sdl_event module rather
than the whole desktop runtime, and the frame loops import app_types by
name so an unrun loop leaves no stub in the checked program.

make pay-per-import-test checks window.zi's exact checked program.
2026-11-15 21:55:30 -03:00
waoziandClaude Opus 5.5 eda083bd73 Keep shadows of objects hidden from the camera
A node hidden with SetVisible still casts its shadow when SetShadows enables
it; shadow maps no longer skip nodes the camera doesn't show.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 20:36:56 -03:00
waozi 0fbdc93884 Show a bare window through its own small loop
App.Show(window) on the desktop no longer runs the frame loop: a new
desktop_window module opens the SDL window, waits for its events, clears
and presents it, and closes it. examples/window.zi now reaches only the
program, kryon/app, the desktop app host, that loop, the SDL presenter and
C strings; its executable is 17 KB instead of 118 KB (265 KB before this
work), with none of the desktop runtime, raster, sessions, input or
accessibility. The window still opens centered, titled, resizable, in the
empty frame's colour, redraws when exposed or resized and exits 0 when
closed or terminated.

make pay-per-import-test now checks that the window carries none of the
frame loop, desktop runtime, raster, accessibility, session or input
modules either.
2026-11-15 16:46:11 -03:00
waozi ba0d3950d3 Let an empty window carry only the window, its events and presenting
Nothing is imported by default. App.Show(window) shows a window without
frames; examples/window.zi uses it and now compiles to 23 C files and
133 KB instead of 62 and 546 KB, with a 118 KB executable instead of 265 KB.

Hosts that run frames (App.Run(window, Draw) and the frame host
desktop_run) call TreeFrameUse() to register the widget tree's frame driver
(tree_frame, through frame_driver): input routing, begin and end of the
frame, cursor shapes, scrolling, gamepad navigation and the test driver's
hooks. The call, not an import, brings it: a module initializer in the tree
would have turned existing import cycles into fatal startup cycles and made
hostless test builds keep every program export.

Accessibility is split. The window keeps the AT-SPI connection and the
application object; widget roles, states and nodes live in
accessibility_tree_linux, which the same hosts register with
AccessibilityTreeUse().

The test driver is in a build only when KRYON_TEST_DRIVER is defined;
desktop_runtime then connects it through test_driver_frame (exported for
other native hosts), and a window started for a test without it stops and
says how to build it. App.Run passes the window's title straight to the
window. input_delivery, frame_input_provider and gamepad_navigation move to
src/ui, InputDeliveryTake to input_take. desktop_loop and test_driver_frame
are exported. The ZX player imports cursor_picture again, so its guests'
picture cursors decode.

make pay-per-import-test builds the window, hello, box and image examples
and checks which modules their generated C carries.
2026-11-15 16:17:07 -03:00
waozi 44bd2bd667 Light painted rooms with north-facing daylight and cast shadows 2026-11-15 16:01:00 -03:00
waozi 8a4e6f05cc Leave pictures, smooth copies, video and threads out of an empty window
The desktop loop called the image decoders (through cursor pictures), the
Lanczos cache and its worker threads, video and the Kryon font every frame,
so every desktop program carried them. Now each part registers itself the
first time it is used: the rasterizer's picture cache and smooth copies when
a frame draws a picture, the font and shaped layouts with the first text,
and video as a named picture source (raster_picture) when it opens. Picture
cursors decode through kryon/cursor again (cursor_picture and the
CursorPictureHost capability, with no-op exports in the hosts without
picture cursors). A widget host no longer imports the decoder; the
application that embeds it imports kryon/cursor.

examples/window.zi now generates 39 C files and 344 KB instead of 62 and
546 KB, and its executable is 179 KB instead of 265 KB. Native desktop
project builds also link X11 explicitly (from the ATR integration lane).
2026-11-15 14:44:27 -03:00
waozi 67e436293f Skip a scene grade that would change nothing
A neutral grade (white tint, full colour, no lamp and no beam), as a
room has for most of the day, now costs no work per pixel on the CPU or
the GPU.
2026-11-15 14:35:08 -03:00
waozi c96178aae8 Light painted scenes by the hour with a scene grade and a daylight sky
Scenes made of painted pictures ignore scene lights, so a time of day had
no way to reach them. Scene.grade tints and desaturates every material not
marked ungraded, and lights it with up to four lamps and a beam through an
elliptical opening such as a round window. The CPU and GPU renderers share
its preparation (PrepareGrade) and agree within the GPU test's tolerance.

kryon/daylight gives the sun's path for any local hour, the grade for that
hour (exactly neutral while the sun is high), warm sun or cool moonlight
through a window, lamps from dusk to dawn, and a storybook sky drawn by one
material shader: a horizon-to-zenith gradient, the sun's glow and disc, two
drifting cloud layers and twinkling stars from tileable noise made in code.
2026-11-15 14:21:27 -03:00
waozi 07d74f6dae Render text as RGBA pixels for lettering on 3D surfaces
TextPixels shapes a string exactly as the window draws it and returns a
straight-RGBA picture: Pango on Cairo for desktop builds, the page canvas
on the web. Hosts use it to paint text into textures, such as a sign that
turns with its door.
2026-11-14 23:51:30 -03:00
waozi 0e66e40ac3 Capture frames through the test driver and build canvas apps without raylib or EGL
The test driver gains a capture command: `capture path=` asks the host for
its next finished frame as a PNG, and DriverCapture sends it from a test.
The desktop host writes the raster it shows (RasterWritePNG); a host that
cannot capture answers "this host does not capture frames" instead of
leaving the test waiting. Hosts capture through TestDriverCapturePath and
TestDriverCaptured. The driver client test covers both answers.

On the web (OS == .WEB) image_pixels decodes with the browser's codecs
through PageImageDecode, so a canvas build no longer links raylib's image
transforms, and scene_gpu links no EGL or GL: its probe reports the GPU
unavailable and SceneGpuRenderOrCPU draws with RenderScene. Jungle's
website builds and draws its 3D rooms this way.
2026-11-14 22:39:16 -03:00
waozi c8a068e343 Keep modal backdrops open by default 2026-11-14 21:25:38 -03:00
waozi 7baf863221 Commit pending scene, input, export and asset work
- GPU scene renderer: moved, turned or scaled nodes re-send only their own
  triangles instead of rebuilding the scene; per-node matrices are reused;
  FreezeGeometry skips geometry comparisons; lights carry projected
  textures (LightCookie) in the CPU and GLES renderers.
- One ordered per-session key and text delivery path across Desktop,
  Canvas and Raylib.
- Context-menu rows show accelerator labels and checked state.
- Bundle apps keep extracted assets that already match instead of
  rewriting and syncing all of them on every open.
- Image and PDF export modules, hosted box tests, brand assets, plans,
  and the ZX changelog entry.
2026-11-14 16:27:22 -03:00
waozi 0cf2c54b50 Expose the PRIMARY selection and keep in-poll modifier taps for Raylib keys
SystemPrimaryText, SystemPrimaryAvailable and SystemPrimarySet read and set
the X11/Wayland PRIMARY selection through the host. The SDL desktop and
Linux Raylib hosts implement it with SDL's primary selection; the Android,
Canvas, pixmap, terminal and bundle hosts report it unavailable instead of
aliasing the ordinary clipboard. Terminal uses it for selections,
middle-click, Shift+Insert and Paste Selection.

RaylibInputPoll took modifiers only from keys still down or just released,
so a Control press released again within the same poll was lost and a
scripted Control+C reached the app as a plain C. Modifier presses from the
pressed-key queue now apply to the keys after them. raylib_window_test
covers the tap.
2026-11-14 10:53:34 -03:00
waozi 92a86b9f25 Add an XDND drag source and GTK check, radio and arrow indicators
Native Linux apps can drag data out to other applications with the optional
kryon/DragSourceLinux module, an XDND version 5 drag source on its own X
connection. It starts while the toolkit keeps its implicit button grab, so
the toolkit still sees the release; it follows the pointer, finds the
top-level XDND window under it (honouring XdndProxy and skipping its own
shaped drag icon), sends Enter, Position, Leave and Drop, answers
XdndStatus, serves the XdndSelection data including TARGETS, and reports
when the pointer is over one of the process's own windows so the app can
handle internal drops. The suggested action follows GTK's modifiers.
tests/drag_source_linux_test.py drops onto an independent python-xlib XDND
target on a private Xvfb from source and saved IR (make
drag-source-linux-test, already part of make test).

GtkStyleIndicatorRaster and GtkPainter kinds 9 to 11 draw the theme's own
check box, radio option and submenu arrow with gtk_render_check,
gtk_render_option and gtk_render_arrow, so native menus show check, radio
and submenu rows as GTK draws them.
2026-11-14 10:21:22 -03:00
waozi 1be70904a3 Remove the semantic DOM backend
No project used the dom profile, and it added a second browser host to
maintain beside Canvas. This removes dom_host, dom_tree, dom_paint, dom_run
and dom_app_run, the dom profile in the project tool, docs/dom.md, and the
DOM tests and their three make targets.

The shared browser code loses its DOM branches: page_events no longer tells
a DOM host about presses, blur and document layout, page_core and
page_texture drop the native DOM flag and the img decode kept for it, and
CanvasAppMainLoop takes no argument. The web template builds a Canvas2D
page. The cursor and rotated text tests cover the Canvas profile only.
2026-11-14 06:04:15 -03:00