From 9bd65a27745012087eb4546d77ef4964663a96a2 Mon Sep 17 00:00:00 2001 From: epoch Date: Sun, 12 Apr 2020 23:50:54 -0500 Subject: added a new idea of using X11 video and /dev/input/event for input. moved hackvr script to bin like it should be. changed makefile stuff to have more consistent ordering of stuff. --- bin/hackvr | 9 +++++++++ src/Makefile | 37 ++++++++++++++++++++++++------------- src/hackvr | 9 --------- src/hackvr_xdie.c | 1 + 4 files changed, 34 insertions(+), 22 deletions(-) create mode 100755 bin/hackvr delete mode 100755 src/hackvr create mode 120000 src/hackvr_xdie.c diff --git a/bin/hackvr b/bin/hackvr new file mode 100755 index 0000000..1c9d16c --- /dev/null +++ b/bin/hackvr @@ -0,0 +1,9 @@ +#!/bin/sh +if [ "_$HACKVR" != "_" -a "_$HACKVR" != "_$0" ];then + exec $HACKVR $* +fi +if [ $DISPLAY ]; then + exec hackvr_x11 $* +else + exec hackvr_fb $* +fi diff --git a/src/Makefile b/src/Makefile index 5c83e45..045f82c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,7 +2,7 @@ PREFIX:=/usr/local/ -BASE_CFLAGS=-Wall -pedantic -std=c99 -ffast-math -I$(PREFIX)/include +BASE_CFLAGS=-g -Wall -pedantic -std=c99 -ffast-math -I$(PREFIX)/include CFLAGS+=$(BASE_CFLAGS) CFLAGS+=-DGRAPHICAL @@ -10,9 +10,12 @@ CFLAGS+=-DGRAPHICAL LDFLAGS+=-L$(PREFIX)/lib #all: hackvr_headless hackvr_x11 hackvr_opengl slowcat ### when hackvr_opengl gets useful at all I'll start including it in default build. -all: hackvr_headless hackvr_x11 slowcat nonblocktail +all: hackvr_xdie hackvr_headless hackvr_x11 slowcat nonblocktail # hackvr_fb hackvr_freeglut slowcat +hackvr_xdie: override LDLIBS+=-lm -lidc -lX11 -lhashtable +hackvr_xdie: hackvr_xdie.o graphics_c3.o graphics_c2.o graphics_cs_x11.o math.o physics.o keyboard.o mouse_die.o keyboard_die.o input.o + nonblocktail: override LDLIBS+=-lidc nonblocktail: nonblocktail.c @@ -34,33 +37,41 @@ hackvr_freeglut: hackvr_freeglut.o graphics_c3_freeglut.o math.o physics.o keybo hackvr_fb.o: CFLAGS+='-DHVR_VERSION="framebuffer"' hackvr_x11.o: CFLAGS+='-DHVR_VERSION="x11"' +hackvr_xdie.o: CFLAGS+='-DHVR_VERSION="x11+die"' hackvr_headless.o: CFLAGS=$(BASE_CFLAGS) hackvr_headless.o: CFLAGS+='-DHVR_VERSION="headless"' install: all mkdir -p $(PREFIX)/bin - install hackvr $(PREFIX)/bin/hackvr - install hackvr_headless $(PREFIX)/bin/hackvr_headless - install hackvr_x11 $(PREFIX)/bin/hackvr_x11 - install slowcat $(PREFIX)/bin/slowcat - install nonblocktail $(PREFIX)/bin/nonblocktail -# install hackvr_fb $(PREFIX)/bin/hackvr_fb -# install hackvr_freeglut $(PREFIX)/bin/hackvr_freeglut + install -t $(PREFIX)/bin hackvr + install -t $(PREFIX)/bin hackvr_headless + install -t $(PREFIX)/bin hackvr_x11 + install -t $(PREFIX)/bin slowcat + install -t $(PREFIX)/bin nonblocktail + install -t $(PREFIX)/bin hackvr_xdie +# install -t $(PREFIX)/bin hackvr_fb +# install -t $(PREFIX)/bin hackvr_freeglut uninstall: rm $(PREFIX)/bin/hackvr rm $(PREFIX)/bin/hackvr_headless rm $(PREFIX)/bin/hackvr_x11 - rm $(PREFIX)/bin/hackvr_fb rm $(PREFIX)/bin/slowcat + rm $(PREFIX)/bin/nonblocktail + rm $(PREFIX)/bin/hackvr_xdie +# rm $(PREFIX)/bin/hackvr_fb +# rm $(PREFIX)/bin/hackvr_freeglut clean: - rm -f hackvr_freeglut +# do *not* rm hackvr. it is a script which doesn't actually belong in this dir so... rm -f hackvr_headless - rm -f hackvr_opengl rm -f hackvr_x11 - rm -f hackvr_fb rm -f slowcat + rm -f nonblocktail + rm -f hackvr_xdie +# rm -f hackvr_opengl +# rm -f hackvr_fb +# rm -f hackvr_freeglut rm -f *.o status: diff --git a/src/hackvr b/src/hackvr deleted file mode 100755 index 1c9d16c..0000000 --- a/src/hackvr +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -if [ "_$HACKVR" != "_" -a "_$HACKVR" != "_$0" ];then - exec $HACKVR $* -fi -if [ $DISPLAY ]; then - exec hackvr_x11 $* -else - exec hackvr_fb $* -fi diff --git a/src/hackvr_xdie.c b/src/hackvr_xdie.c new file mode 120000 index 0000000..e4c9ddd --- /dev/null +++ b/src/hackvr_xdie.c @@ -0,0 +1 @@ +hackvr.c \ No newline at end of file -- cgit v1.2.3