aboutsummaryrefslogtreecommitdiffstats
path: root/README
blob: f028f76ea26816da5746771f3df7fba6b52d310f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
 _   _    ___     ___    _  _  __    __  ____
| |_| |  / _ \   / __\  | |/ / \ \  / / |  _ \
|  _  | |  _  | | (__   |   <   \ \/ /  |    /
|_| |_| |_| |_|  \___/  |_|\_\   \__/   |_|\_\
(everything is better with ascii-art)

hackvr... um. outputs commands to stdout based on keys pressed inside hackvr,
and inputs the same type of commands.
so do some plumbing and get a multiplayer game going?

How about a nice GL version written in zig made by someone else?
https://git.random-projects.net/xq/hackvr-turbo

It looks a lot nicer than my stuff.

::::::::::::::::::::
::: DEPENDENCIES :::
::::::::::::::::::::

You'll need to have the library and headers of libx11 installed for hackvr to build successfully.
Which usually means you will need the dev version of the libx11 (xlib) package for your distro.
To get that on debian:

  apt-get install libx11-dev

If you want to build the GLut crap you'll need
  
  freeglut3-dev

Since I first wrote this README, I pushed a couple other libraries I've written into hackvr.
You'll need those too.

libidc (select() wrapper pretty much)
libhashtable (LIBrary for HASH TABLEs.)

You can usually get these libs from the same place you got hackvr.

where to find hackvr:
git://git.thebackupbox.net/hackvr
git://main.lv/hackvr
https://github.com/kkabrams/hackvr

where to find libidc:
git://git.thebackupbox.net/libidc
git://main.lv/libidc
https://github.com/kkabrams/libidc

where to find libhashtable:
git://git.thebackupbox.net/libhashtable
git://main.lv/libhashtable
https://github.com/kkabrams/libhashtable


::::::::::::::::
::: BUILDING :::
::::::::::::::::

I have a script that just runs make with PREFIX=$PREFIX prefix=$PREFIX so I end up with
everything installed under ~/.local/

You should be able to do these to get hackvr built:

  make #BSD make doesn't do target specific variables. use GNUMake.

On my raspi I have to run make with LDLIBS=-lgcc_s
The make install will create (at least) the following programs:

:: hackvr_headless ::
This doesn't output to any display, but you can still read commands in, do manipulations
then export them back out. This can make writing a few scripts for hackvr easier
and it can also compress any long list of hackvr commands.

:: hackvr_x11 ::
This is the binary I use most on my desktop. It outputs to a single X11 window,
and gets its input events from that same X11 window.

:: hackvr_fb ::
This outputs to the /dev/fb0 device so you can run hackvr without an X11 server if you want.
It uses /dev/input/events for user input.

:: hackvr_xdie ::
This is a mix of the last two programs. It outputs to an X11 window, but uses
/dev/input/events for user input.

:: hackvr_svg ::
This uses /dev/input/events for user input, and each screen-draw it overwrites an HTML file
in /tmp that contains an inline SVG with an autorefresh. I think this program was meant
as a joke to myself. Still kind of funny.

:::::::::::::::
::: INSTALL :::
:::::::::::::::

The way I install updated hackvr binaries is this way:

  export PREFIX=$(HOME)/.local #the Makefiles are short, worth a read.
  make install

If you didn't want to make install the libraries, there are variables you can set to
let the makefile know where they are:

LIBIDC_INCLUDE_PATH
LIBIDC_LIB_PATH
LIBHASHTABLE_INCLUDE_PATH
LIBHASHTABLE_LIB_PATH

They should be set to where the .h and .so are, and not a subdir like how $(PREFIX) is set
since the include and lib dirs don't exist inside the libs.

A few helper scripts are written in perl and python.
So you might want to install perl and python if you want to play with them.
They're pretty nifty.

::::::::::::::
::: Extras :::
::::::::::::::

There is another repo that contains a lot of experiments, examples, toys, and, well, extra files.
stuff like a vector font.
something that renders a terminal using it into hackvr.
a clock.
dungeon map generator and viewer.
etc.

git://git.thebackupbox.net/hackvr-extras

:::::::::::::::::::
::: Stereoscopy :::
:::::::::::::::::::

Right now there's side-by-side mode and red-and-blue mode.

You'll have to either enable this using a command sent to hackvr's stdin that
I don't even remember, or just enable it in config.h make clean then rebuild.
Be sure to have SPLIT_SCREEN set to 2 while you have RED_AND_BLUE set to 1.
Otherwise you'll just end up with one camera that is red. Three cameras will
draw a third view that is also red. (colors of views are picked by modulo two of
camera number atm)

left eye should have red over it.
right eye should have blue over it.

if your glasses are backwards you can either wear them upside down.
or just flip the value of CAMERA_SEPARATION in config.h before building.
or fiddle with it using the 'p' and 'l' keys while hackvr is running.