diff --git a/Makefile b/Makefile index 5f40f8e..248d826 100644 --- a/Makefile +++ b/Makefile @@ -28,8 +28,8 @@ PLATFORM ?= PLATFORM_DESKTOP LIBRAYLIB := libraylib.a -DISPLAY_WIDTH := 800 -DISPLAY_HEIGHT := 600 +DISPLAY_WIDTH ?= 800 +DISPLAY_HEIGHT ?= 600 WEB_OUTPUT_DIR := web WEB_OUTPUT := $(WEB_OUTPUT_DIR)/miniRT @@ -146,10 +146,10 @@ $(OUT_DIR): $(OBJDIR): mkdir -p $(OBJDIR) $(OBJDIR)/$(SRCDIR) $(OBJDIR)/$(RENDERDIR) $(OBJDIR)/$(IODIR) $(OBJDIR)/$(UTILDIR) $(OBJDIR)/$(SCENEDIR) -vnc: clean clean_vnc all +vnc: clean_vnc $(NAME) all $(VNC_SCRIPT) $(DISPLAY_WIDTH) $(DISPLAY_HEIGHT) -clean_vnc: clean +clean_vnc: pkill -9 websockify || true pkill -9 Xvnc || true diff --git a/out/miniRT b/out/miniRT new file mode 100755 index 0000000..9d41a2d Binary files /dev/null and b/out/miniRT differ diff --git a/raylib/src/config.h b/raylib/src/config.h index dc6cc58..88d1807 100644 --- a/raylib/src/config.h +++ b/raylib/src/config.h @@ -59,7 +59,7 @@ // Use a partial-busy wait loop, in this case frame sleeps for most of the time, but then runs a busy loop at the end for accuracy #define SUPPORT_PARTIALBUSY_WAIT_LOOP 1 // Allow automatic screen capture of current screen pressing F12, defined in KeyCallback() -#define SUPPORT_SCREEN_CAPTURE 1 +//#define SUPPORT_SCREEN_CAPTURE 1 // Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback() #define SUPPORT_GIF_RECORDING 1 // Support CompressData() and DecompressData() functions diff --git a/scripts/run_vnc.sh b/scripts/run_vnc.sh new file mode 100755 index 0000000..3b230b4 --- /dev/null +++ b/scripts/run_vnc.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +NOVNC="" + +XVNC=Xvnc +XVNC_HOST=0.0.0.0 +XVNC_PORT=5901 + +DISPLAY_WIDTH=$1 +DISPLAY_HEIGHT=$2 + +DISPLAY=:69 + +print_usage() { + echo "Usage: run_vnc.sh " +} + +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 +fi + +if ! command -v Xvnc &> /dev/null; then + echo "Xvnc not found! Aborting..." + exit 1 +fi + +if [[ "$DISPLAY_WIDTH" = "" || "$DISPLAY_HEIGHT" = "" ]] ; then + print_usage + exit 1 +fi + +$XVNC ${DISPLAY} \ + -geometry ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT} \ + -depth 24 \ + -SecurityTypes None \ + -interface $XVNC_HOST \ + -rfbport $XVNC_PORT & + +sleep 2 + +$NOVNC --vnc localhost:${XVNC_PORT} --listen 7080 & + +sleep 2 + +exec ./out/miniRT