-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathREADME
More file actions
executable file
·105 lines (75 loc) · 3.92 KB
/
README
File metadata and controls
executable file
·105 lines (75 loc) · 3.92 KB
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
Herein lies the README for a project known as Pineapple and Pocky.
Fall 2011, Android Game Development, CS195N Brown University
Authors
Paul Sastrasinh (psastras@cs.brown.edu)
Justin Kim (jhk2@cs.brown.edu)
To compile on department machines:
Startup /contrib/projects/eclipse-android-ndk/eclipse/eclipse
Add pineapple and pocky to your workspace
If you want, change the LATENCY variable in the PockyState.cpp, depending on your device.
Hit the green button.
If the compile fails, hit the green button again, it might take two tries -
there seems to be a Makefile dependency issue somewhere.
If eclipse gives build errors and refuses to build, select all the build errors
and hit delete and build again.
Uploading might take a little while (1 min) because of APK size.
Pineapple
Pineapple is a C++ game engine library written for Android (specifically
targeting Android 8 devices and higher). It uses OpenGL ES 2.
It supports (among other things)
+ OpenGL and GLSL rendering
+ Text rendering
+ Animation
+ Touch input
+ Audio manipulation / playback
+ Asset management
+ PNG image loading
+ Audio loading (WAV)
+ ttf font loading
Pocky
Pocky is a little game implemented using Pineapple's game engine library.
It communicates with Pineapple using Android's NDK and JNI.
Building
Since Pocky relies on Pineapple, Pineapple must be built first. The only
dependency required is the Android NDK with bundled stdlib ports. All other
dependencies are included within the project and are compiled automatically.
Pineapple is distributed with a few third party libraries. Each third party
library used is listed below (as well as how they are used)
libpng
Since Android 8 devices do not support native PNG loading, libpng
is used to read in images.
libzip
Android 8 devices do not support native asset loading. To fix this
the APK is unzipped at runtime and the assets are loaded into memory
using libzip.
OpenAL
Android 8 devices do not support native sound management. OpenAL (with
tremolo) is used for native sound support.
font-builder
Android native does not support font loading / rendering. At compile time
ttf files are converted into a readable texture format, which can then be
rendered using OpenGL.
Pocky and Pineapple are both Makefile based projects. The Makefiles can be found
in the root directory of each project.
The build process of Pocky can be broken down into the following steps.
1. Code Generation
Much of the code in Pocky is generated at compile time. These mostly take
the form of headers. All headers found in pineapple/jni/include/,
extern/fonts are regenerated at compile time and should not be modified.
JNI headers are automatically generated from JAVA files found in pineapple/src/lib
and pocky/src lib. Java classes should only be added to these folders if a JNI
header needs to be generated. Otherwise these classes should belong in the main/
folder.
Font headers are generated for each of the ttf fonts contained in build-tools/font-to-texture/fonts/
Each ttf file must be alpha numerically named or an error will occur. These headers
are placed in extern/fonts (one for each font). Each header includes the font character
data (positions, texture coordinates), and the bitmap texture data (which can be loaded
into OpenGL). Finally the Font.h header is generated containing methods to access
the different fonts.
The Compile.h header contains build information (ex. Compile time, build number, etc.).
2. Android Makefile Generation
Android.mk files are generated for the Pineapple and Pocky projects.
3. Compilation
The Pineapple library is statically linked against libzip, libpng, and libOpenAL
to form a shared library, libpineapple.so. Pocky is then linked against the
pineapple shared library during compilation.