Adds demo_view_rotate_z_around() which compensates translation
so the point between the two fingers stays fixed during rotation,
like maps apps.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two-finger pinch now does both zoom (distance change) and Z-axis
rotation (angle change) simultaneously. Adds demo_view_rotate_z()
for direct Z-axis rotation from touch input.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Only toggle on keydown (not keyup). Remove vsync from web help.
Format key names with spaces.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Press ? or / to show full keyboard/mouse/touch reference.
Esc or ? again to dismiss.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wine may not properly restore windowed mode after fullscreen.
Works on native Windows.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Disable backface culling (both triangles per quad need to render).
Handle Esc/Q to quit via DestroyWindow. Wire vsync toggle to
swap chain present interval.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The library's hb_gpu_fetch references the global hb_gpu_atlas,
so its StructuredBuffer declaration must precede the library
source in the concatenated shader.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
D3D11 renderer using Win32 windowing and runtime HLSL compilation.
Cross-compiles with MinGW, runs under Wine with DXVK.
Also fixes demo-common.h to guard GL/GLFW includes behind
HB_GPU_NO_GLFW, renames near/far to znear/zfar in demo-view
(reserved on Windows), and adds QueryPerformanceCounter timer
for Win32.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wire up the 'd' key debug mode using _hb_gpu_curve_counts from
the library MSL shader. Same R/G/B heatmap as GL and WebGPU:
red = horizontal curve count, green = vertical, blue = coverage.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Now that the WGSL shader has _hb_gpu_curve_counts, wire up
the debug uniform and heatmap visualization. Same R/G/B output
as the GL demo.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Check canvas size each frame and reconfigure the WebGPU surface
when it changes. Fixes black screen when toggling dev tools or
resizing the browser window.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Same algorithm as GL: pow(coverage, exp) where exp varies by
foreground brightness and ppem, smoothly transitioning to no
effect above 48ppem. Toggled with 's' key, on by default.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Same per-pixel coverage adjustment as the GL demo. Replaces
unused debug uniform with stem_darkening in the uniform buffer.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adjust coverage at small sizes to compensate for gamma washing
out thin stems. Dark-on-light gets pow(cov, 0.7) to fatten,
light-on-dark gets pow(cov, 1.4) to thin. Smoothly transitions
to no effect above 48ppem. Applied before gamma correction so
it works with sRGB, gamma 2.2, and none.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Self-contained HTML with embedded font and text, same controls
as GPU demos (pan, zoom, 3D rotation, drag-release animation).
Useful for comparing DOM text rendering performance vs GPU.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Self-contained HTML with embedded font (base64) and default text.
Same controls as GPU demos. Useful for comparing rendering
performance: DOM vs WebGL vs WebGPU.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show helpful error with link to webglreport.com when WebGL2
context creation fails (e.g. Firefox with hardware acceleration
disabled or GPU blocklisted).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Map DOM button 1 (middle) to GLFW middle button so middle-click
reset and middle-drag zoom work.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace separate .glsl files and generated .hh headers with C++11
raw string literals (R"glsl(...)glsl") directly in demo-shader.cc.
Matches the pattern already used by demo-metal.mm and the WebGPU
demo. Removes demo shader generation from meson and the generator
script.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add missing set_debug() to Metal renderer.
Cast float to double in demo-shader.h vertex extents.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The WGSL shader compilation fails with _hb_gpu_curve_counts.
Debug mode is available in desktop and WebGL demos.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Refactor library fragment shaders (GLSL, MSL, WGSL) to extract
_hb_gpu_decode_glyph and _hb_gpu_curve_counts helpers, used by
both hb_gpu_render and the debug visualization.
Debug mode (d key) shows per-pixel curve counts as a heatmap:
R = horizontal band curves, G = vertical band curves, B = text
coverage. Scale 0-8 curves maps to 0-1 intensity.
Also auto-generates demo shader headers via meson, and adds
set_debug to the renderer interface.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Three-finger drag on mobile now does trackball rotation, matching
right-drag on desktop. Uses centroid of three touch points.
Release with momentum triggers spin animation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Clamp dquat[3] to [-1, 1] before acos() to prevent NaN from
float imprecision. Without the clamp, slightly-out-of-range
quaternion w values make rot_speed NaN, poisoning the quaternion
and causing text to disappear until reset.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Don't call demo_view_motion_func in on_mouseup — it zeros dx/dy
(same position as last mousemove), killing the velocity needed
for drag-release spin detection. Also remove debug printfs.
Track active_buttons to filter spurious document-level mouseup
events from UI controls while still catching drag releases
outside the canvas.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Refactor demo_view to work without GLFW (guarded by HB_GPU_NO_GLFW):
- Add demo_view_create_headless() for non-GLFW use
- Store fb/window dimensions in the view struct
- Use emscripten_get_now() for timing when on Emscripten
- Guard GLFW-specific calls (fullscreen, window close, cursor query)
Rewrite WebGPU entry point to use demo_view and demo_renderer_t
interface instead of duplicated view/input code. This gives the
WebGPU demo identical trackball rotation, drag-release animation,
keyboard shortcuts, and gamma cycling as the GL demos.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>