-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Embedded
135 lines (109 loc) · 6.31 KB
/
README.Embedded
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
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////// Introduction /////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
This is a port of BZFlag (http://bzflag.org) to embedded devices using OpenGL
ES. Most of the original features were preserved. The few exceptions were for
functionality that either doesn't exist or doesn't make sense to implement
on OpenGL ES (draw lists, stipples, automatic texture coordinate generation,
etc.).
This port was done by Joshua Bodine. Unlike contributions to the main BZFlag
repository, the copyright for all changes related to this port IS NOT turned
over to Tim Riker and is retained by the author. An attempt was made to
indicate in the header of any affected files that the copyright on any
changes was retained. Tim Riker retains copyright of the source code for the
original BZFlag project.
This source code is licensed under the GNU Lesser Public License (LGPL)
version 2.1, just like the main BZFlag source code.
///////////////////////////////////////////////////////////////////////////////
////////////////////////////////// Building ///////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
This project targets multiple embedded device platforms. Instructions for
building for several devices/platforms are below. You may have success getting
this project to build for other devices/platforms as well. If you do, please
let the author know so instructions can be included here.
//////////////////////////////// Raspberry Pi /////////////////////////////////
The following is an example of commands to build on a Raspberry Pi with a
barebones Raspbian installation. If you have already installed some packages
on your system, you may not need to install all of the listed packages.
$ # Install packages
$ sudo apt-get install autoconf libtool libc-ares-dev libcurl4-openssl-dev \
libncurses-dev mercurial libudev-dev libasound2-dev
$ # Until a newer version of SDL 2 is available, it must be built from source
$ hg clone http://hg.libsdl.org/SDL
$ cd SDL
$ ./autogen.sh
$ ./configure
$ make -j`nproc`
$ sudo make install
$ cd ..
$ # Set up the compiler flags
$ export CPPFLAGS=-I/opt/vc/include
$ export LDFLAGS=-L/opt/vc/lib
$ # Retrieve and build GLU for OpenGL ES
$ git clone https://github.com/macsforme/glues.git
$ cd glues
$ ./autogen.sh
$ ./configure
$ make -j`nproc`
$ sudo make install
$ cd ..
$ # Retrieve and build BZFlag for Embedded Devices
$ git clone https://github.com/macsforme/bzflag-embedded.git
$ cd bzflag-embedded
$ ./autogen.sh
$ ./configure --with-gles
$ make -j`nproc`
$ sudo make install
IMPORTANT: Prior to running bzflag, to avoid a possible system lockup,
increase the amount of memory allocated to the GPU by navigating in the menus
to Menu->Prefrences->Raspberry Pi Configuration->Performance->GPU Memory and
increasing the amount (128MB might be enough). You may then run BZFlag from
the source directory or from the installation directory.
Note that there is a known issue where if you run BZFlag from the command line
outside of X, after the game exits the command line is frozen and does not
accept any further input. You may need to kill the session using another
terminal.
///////////////////////////////////// iOS /////////////////////////////////////
This project should build and run on iOS devices, but functionality is
currently limited. There are only basic touch controls: swipe up/down/left/
right with one finger for arrows, swipe up/down with two fingers to scroll the
console, swipe left/right with two fingers to switch console tabs, tap with
one finger for return, tap with two fingers for escape and tap with three
fingers to toggle the on-screen keyboard. These controls are mostly only
useful for observer mode at this point. However, it is possible to use the
on-screen keyboard to manipulate the settings, chat with people and send
server commands.
Xcode 7.0 or later is required to build. To retrieve the source code, clone
the repository using Git in the following manner:
$ git clone https://github.com/macsforme/bzflag-embedded.git
Once you have done so, navigate to the Xcode project at
bzflag-embedded/Xcode/BZFlag.xcodeproj, and double-click on it to open it.
IMPORTANT: the first time you build the project, a build script will attempt
to download all the necessary dependencies from the internet. Make sure you
are connected to the internet for this purpose.
You may build the project for any of the available device simulators, or you
may build it to run on a physical device. To make your selection, first plug
in your device if applicable, then click on the "BZFlag" button near the top
left area of the project window. Under the "BZFlag" target, select the device
or simulator you are targeting. Once you have made your selection, proceed
with building the project.
IMPORTANT: to deploy the application to an iOS device, you must have a signing
identity set up in Xcode. If you already have a paid developer account with
Apple, you may use your existing signing identity. If not, you may create a
free signing identity to test the application on devices that you own. Select
the BZFlag project in the navigator pane, and then near the top left of the
center pane, select the BZFlag application target from the drop-down menu.
Make sure the "General" tab is selected, then find the setting for "Team," and
then below that click the button for "Fix Issue." Add your Apple ID to Xcode,
and then follow the prompts to create a "Personal Team," which you can then
use to sign the application. Once you build the project and attempt to run it,
Xcode may report an error related to security. To correct this, unlock your
device and navigate to the Settings application. Select "General," then
"Profile" near the bottom, then select your profile and configure your device
to trust that profile. You should then be able to run the application. If
Xcode reports an error regarding the device being locked even though it is
not, try disconnecting and re-connecting the device, or try shutting down both
Xcode and the device and then starting them both up again.
To test the application, run it from Xcode. After launching for the first time
from Xcode, the application should remain on your device and you can launch it
like any other application.