updated Makefile and script

This commit is contained in:
Victor Vobis 2026-02-11 10:47:42 +01:00
parent 6fb55ef07b
commit d6efed6177
3 changed files with 19 additions and 4 deletions

View File

@ -58,7 +58,7 @@ OBJDIR := $(OBJDIR_BASE)/native
endif endif
VNC_SCRIPT := ./script/run_vnc.sh VNC_SCRIPT := ./scripts/run_vnc.sh
SCENEDIR := scene SCENEDIR := scene
SRCSCENE := $(addprefix $(SCENEDIR)/, $(addsuffix .c,\ SRCSCENE := $(addprefix $(SCENEDIR)/, $(addsuffix .c,\

BIN
miniRT Executable file

Binary file not shown.

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
NOVNC=""
XVNC=Xvnc XVNC=Xvnc
XVNC_HOST=0.0.0.0 XVNC_HOST=0.0.0.0
XVNC_PORT=5901 XVNC_PORT=5901
@ -7,8 +9,16 @@ XVNC_PORT=5901
DISPLAY_WIDTH=$1 DISPLAY_WIDTH=$1
DISPLAY_HEIGHT=$2 DISPLAY_HEIGHT=$2
if ! command -v novnc_proxy &> /dev/null; then print_usage() {
echo "noVNC (novnc_proxy) not found! Aborting..." echo "Usage: run_vnc.sh <width> <height>"
}
if command -v novnc_proxy &> /dev/null; then
NOVNC=novnc_proxy
elif command -v novnc &> /dev/null; then
NOVNC=novnc
else
echo "noVNC (novnc_proxy || novnc) not found! Aborting..."
exit 1 exit 1
fi fi
@ -17,6 +27,11 @@ if ! command -v Xvnc &> /dev/null; then
exit 1 exit 1
fi fi
if [[ "$DISPLAY_WIDTH" = "" || "$DISPLAY_HEIGHT" = "" ]] ; then
print_usage
exit 1
fi
$XVNC :1 \ $XVNC :1 \
-geometry ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT} \ -geometry ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT} \
-depth 24 \ -depth 24 \
@ -26,7 +41,7 @@ $XVNC :1 \
sleep 2 sleep 2
novnc_proxy --vnc localhost:${XVNC_PORT} & $NOVNC --vnc localhost:${XVNC_PORT} &
sleep 2 sleep 2