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. --- src/Makefile | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'src/Makefile') 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: -- cgit v1.2.3 From ebc7381301c06c31933d11ff3e2b68ca005aa3e7 Mon Sep 17 00:00:00 2001 From: epoch Date: Sun, 12 Apr 2020 23:57:34 -0500 Subject: noticed I don't need input.o in the makefile anymore --- src/Makefile | 5 +++-- src/input.c | 19 ------------------- src/input.h | 14 ++++++++++---- 3 files changed, 13 insertions(+), 25 deletions(-) delete mode 100644 src/input.c (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 045f82c..6ed9c5d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -14,7 +14,7 @@ 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 +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 nonblocktail: override LDLIBS+=-lidc nonblocktail: nonblocktail.c @@ -23,7 +23,8 @@ hackvr_headless: override LDLIBS+=-lm -lidc -lhashtable hackvr_headless: hackvr_headless.o math.o physics.o hackvr_x11: override LDLIBS+=-lm -lidc -lX11 -lhashtable -hackvr_x11: hackvr_x11.o graphics_c3.o graphics_c2.o graphics_cs_x11.o math.o physics.o keyboard.o mouse_x11.o keyboard_x11.o input.o +hackvr_x11: hackvr_x11.o graphics_c3.o graphics_c2.o graphics_cs_x11.o math.o physics.o keyboard.o mouse_x11.o keyboard_x11.o + #notice how all the targets have generic graphics objects up until a specific one. hackvr_fb: override LDLIBS+=-lm -lidc -lhashtable diff --git a/src/input.c b/src/input.c deleted file mode 100644 index 8c1b99b..0000000 --- a/src/input.c +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include "common.h" -#include "graphics_x11.h" -#include "keyboard_x11.h" -#include "mouse_x11.h" -#include "input.h" - -extern struct x11_global x11_global; - -int input_init() { - return x11_global.fd; -} - -void input_event_handler(struct shit *me,char *line) { - if(keyboard_event_handler(me,line)) { - } - if(mouse_event_handler(me,line)) { - } -} diff --git a/src/input.h b/src/input.h index 15b28f4..0c878e6 100644 --- a/src/input.h +++ b/src/input.h @@ -1,11 +1,17 @@ #ifndef _HV_MOUSE_H_ #define _HV_MOUSE_H_ +//these might as well be in keyboard.h and mouse.h +//but I don't have separate files for those yet. +//all keyboard and mouse drivers will need to implement these functions + #include -int input_init(); -void input_event_handler(struct shit *me,char *line); -int mouse_event_handler(); -int keyboard_event_handler(); +//these *_init() will return the fd that will have the keyboard and mouse events +int mouse_init(); +int keyboard_init(); +//these two functions are libidc handlers +void mouse_event_handler(struct shit *,char *); +void keyboard_event_handler(struct shit *,char *); #endif -- cgit v1.2.3 From 9931a28668db34e7f6975de1231ea23881d7c361 Mon Sep 17 00:00:00 2001 From: epoch Date: Mon, 13 Apr 2020 01:00:32 -0500 Subject: forgot to remove the hackvr script from the install target --- src/Makefile | 1 - 1 file changed, 1 deletion(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 6ed9c5d..9ad35e6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -44,7 +44,6 @@ hackvr_headless.o: CFLAGS+='-DHVR_VERSION="headless"' install: all mkdir -p $(PREFIX)/bin - install -t $(PREFIX)/bin hackvr install -t $(PREFIX)/bin hackvr_headless install -t $(PREFIX)/bin hackvr_x11 install -t $(PREFIX)/bin slowcat -- cgit v1.2.3 From 5645a847566870877c026f58c80732599136a6ab Mon Sep 17 00:00:00 2001 From: epoch Date: Tue, 14 Apr 2020 06:05:47 -0500 Subject: added hackvr_fb back into the default build --- src/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 9ad35e6..5803a1a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -10,7 +10,7 @@ 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_xdie hackvr_headless hackvr_x11 slowcat nonblocktail +all: hackvr_fb hackvr_xdie hackvr_headless hackvr_x11 slowcat nonblocktail # hackvr_fb hackvr_freeglut slowcat hackvr_xdie: override LDLIBS+=-lm -lidc -lX11 -lhashtable @@ -49,7 +49,7 @@ install: all 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_fb # install -t $(PREFIX)/bin hackvr_freeglut uninstall: @@ -59,7 +59,7 @@ uninstall: rm $(PREFIX)/bin/slowcat rm $(PREFIX)/bin/nonblocktail rm $(PREFIX)/bin/hackvr_xdie -# rm $(PREFIX)/bin/hackvr_fb + rm $(PREFIX)/bin/hackvr_fb # rm $(PREFIX)/bin/hackvr_freeglut clean: @@ -70,7 +70,7 @@ clean: rm -f nonblocktail rm -f hackvr_xdie # rm -f hackvr_opengl -# rm -f hackvr_fb + rm -f hackvr_fb # rm -f hackvr_freeglut rm -f *.o -- cgit v1.2.3