mirror of
https://github.com/DeeJanuz/frametop.git
synced 2026-10-06 03:00:06 +02:00
Where frame-hands tracks a hand between an eye and a screen, that eye sees the room through the screen. handcut.cpp draws the screen's buffer side by side (one half per eye) with the hands cut out, only while a hand is in front of it. The cutouts command turns it on or off. ft-handtest tries it on a test panel. Not yet tested in the headset. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
25 lines
1.7 KiB
Bash
Executable File
25 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build ft-screens in the dev container on the Frame (screens/build/ft-screens), and
|
|
# ft-handtest, which tries the hand cutouts (handcut.cpp) on a test panel of its own.
|
|
# compositor.c is the wlroots side (C; wlroots headers aren't C++), vr.cpp the OpenVR side.
|
|
# vr.cpp needs OpenVR's IVRIPCResourceManagerClient (ImportDmabuf), which the header
|
|
# shipped with SteamVR on the Frame predates, so the build uses the public header from
|
|
# Valve's openvr repo (pinned; the Frame's runtime supports its interface versions).
|
|
set -euo pipefail
|
|
root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
|
"$root/scripts/sync.sh" >/dev/null
|
|
exec "$root/scripts/frame.sh" -C screens 'set -e; mkdir -p build/include
|
|
openvr=v2.15.6
|
|
[ -f build/include/openvr-$openvr ] || { curl -fsSL "https://raw.githubusercontent.com/ValveSoftware/openvr/$openvr/headers/openvr.h" -o build/include/openvr.h && touch build/include/openvr-$openvr; }
|
|
gcc -std=c11 -O2 -Wall -Wno-unused-parameter -c -o build/compositor.o compositor.c \
|
|
$(pkg-config --cflags wlroots-0.20 wayland-server xkbcommon libdrm pixman-1)
|
|
cxx="g++ -std=c++17 -O2 -Wall -Wno-missing-field-initializers -Ibuild/include $(pkg-config --cflags egl glesv2 gbm libdrm)"
|
|
$cxx -c -o build/vr.o vr.cpp
|
|
$cxx -c -o build/handcut.o handcut.cpp
|
|
$cxx -c -o build/handtest.o handtest.cpp
|
|
vrlibs="$(pkg-config --libs egl glesv2 gbm) -L/opt/steamvr/bin/linuxarm64 -lopenvr_api -Wl,-rpath,/opt/steamvr/bin/linuxarm64"
|
|
g++ -o build/ft-screens build/compositor.o build/vr.o build/handcut.o \
|
|
$(pkg-config --libs wlroots-0.20 wayland-server xkbcommon) $vrlibs
|
|
g++ -o build/ft-handtest build/handtest.o build/handcut.o $vrlibs
|
|
echo "built build/ft-screens build/ft-handtest"'
|