Changes between Version 195 and Version 196 of AndroidPort
- Timestamp:
- Feb 1, 2012, 7:04:57 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AndroidPort
v195 v196 105 105 106 106 I think the best approach is to extend graphics/!ShaderProgram.cpp to support GLSL shaders (it was designed with that in mind, but I don't know if it'll actually work without some interface changes); then move all the renderer's existing fixed-function texture-environment setup code into ShaderProgramFFP.cpp and implement GLSL-based equivalents, so that most of the rest of the renderer code doesn't have to care whether it's using FFP or GLSL (it just uses the CShaderProgram interface). Also, change all immediate-mode drawing (glVertex3f etc) to vertex arrays. I think that should deal with the most serious problems, and the code would all be shared between GLES and desktop GL modes (no need for forking or #ifdefs etc) and can be tested with desktop GL. Then there's probably just lots of little issues remaining, which can be addressed as they occur. 107 108 See [wiki:SLESPort]. 107 109 108 110 === Other dependencies === … … 167 169 $ tar -xvf android-ndk-r5-crystax-2-linux-x86.tar.bz2 168 170 }}} 169 170 171 Now use the NDK to set up a standalone toolchain: 171 172 … … 173 174 $ ~/android/android-ndk-r5-crystax-2/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=$HOME/android/toolchain 174 175 }}} 175 176 176 You also must install a Java Development Kit (JDK) if you haven't already, e.g. [https://apps.ubuntu.com/cat/applications/oneiric/default-jdk/ the standard JDK from Ubuntu Software Center]: 177 177 … … 189 189 $ sudo apt-get install ia32-libs 190 190 }}} 191 192 191 === Installing replacement libraries === 193 192 The game has a range of external dependencies. Each of these has to be compiled for the target device's processor architecture and installed in the compiler toolchain's SYSROOT, so we can link against them when building the game itself. … … 199 198 $ tar -xvf MysticTreeGames-Boost-for-Android-70838fc.tar.gz 200 199 }}} 201 202 200 Now change directory to the directory that was unpacked, e.g.: 203 201 … … 205 203 $ cd MysticTreeGames-Boost-for-Android-70838fc 206 204 }}} 207 208 205 Then execute the following command to download the Boost C++ Libraries package and compile it for the target device: 209 206 … … 211 208 $ ./build-android.sh ~/android/android-ndk-r5-crystax-2 212 209 }}} 213 214 210 Copy the resulting headers and library files into the `usr` directory in the toolchain's SYSROOT: 215 211 … … 217 213 $ cp -r build/* ~/android/toolchain/sysroot/usr/ 218 214 }}} 219 220 221 215 Set up the environment for cross-compiling using the standalone toolchain: 222 216 … … 242 236 $ export LDFLAGS="-L${NDK}/sources/crystax/libs/armeabi-v7a -lcrystax" 243 237 }}} 244 245 238 Download the development snapshot for SDL 1.3 from [http://www.libsdl.org/hg.php this page] to the working directory and then unpack it there, e.g.: 246 239 … … 249 242 $ tar -xvf SDL-1.3.tar.gz 250 243 }}} 251 252 244 Now change directory to the directory that was unpacked, e.g.: 253 245 … … 255 247 $ cd ~/android/SDL-1.3.0-6235 256 248 }}} 257 258 249 Then execute the following commands to compile the package for the target device: 259 250 … … 263 254 $ make install 264 255 }}} 265 266 256 Download the latest version of cURL from [http://curl.haxx.se/download.html this page] to the working directory and then unpack it there, e.g.: 267 257 … … 270 260 $ tar -xvf curl-7.24.0.tar.bz2 271 261 }}} 272 273 262 Now change directory to the directory that was unpacked, e.g.: 274 263 … … 276 265 $ cd ~/android/curl-7.24.0 277 266 }}} 278 279 267 Then execute the following commands to compile the package for the target device: 280 268 … … 284 272 $ make install 285 273 }}} 286 287 274 Download the latest version of libpng from [http://www.libpng.org/pub/png/libpng.html this page] to the working directory and then unpack it there, e.g.: 288 275 … … 291 278 $ tar -xvf libpng-1.5.7.tar.xz 292 279 }}} 293 294 280 Now change directory to the directory that was unpacked, e.g.: 295 281 … … 297 283 $ cd ~/android/libpng-1.5.7 298 284 }}} 299 300 285 Then execute the following commands to compile the package for the target device: 301 286 … … 305 290 $ make install 306 291 }}} 307 308 292 The game depends on libjpeg. We will use libjpeg-turbo, an ABI-compatible fork of libjpeg that adds support for SIMD processing, giving us maximal performance with the target processor's ARM NEON engine. 309 293 … … 314 298 $ tar -xvf libjpeg-turbo-1.1.1.tar.gz 315 299 }}} 316 317 300 Now change directory to the directory that was unpacked, e.g.: 318 301 … … 320 303 $ cd ~/android/libjpeg-turbo-1.1.1 321 304 }}} 322 323 305 Then execute the following commands to compile the package for the target device: 324 306 … … 328 310 $ make install 329 311 }}} 330 331 312 Download the latest version of libxml2 from [http://xmlsoft.org/downloads.html this page] to the working directory and then unpack it there, e.g.: 332 313 … … 335 316 $ tar -xvf libxml2-2.7.8.tar.gz 336 317 }}} 337 338 318 Now change directory to the directory that was unpacked, e.g.: 339 319 … … 341 321 $ cd ~/android/libxml2-2.7.8 342 322 }}} 343 344 323 Then execute the following command to configure the package for the target device: 345 324 … … 347 326 $ ./configure --host=$HOSTCONF --build=$BUILDCONF --prefix=$SYSROOT/usr --without-threads --without-iconv --without-python --enable-shared 348 327 }}} 349 350 328 Hand-edit the Makefile to remove `runtest$(EXEEXT)` and `testrecurse$(EXEEXT)` from the `noinst_PROGRAMS` definition, e.g. 351 329 … … 359 337 runxmlconf$(EXEEXT) 360 338 }}} 361 362 339 Finally, execute the following commands to compile the package: 363 340 … … 366 343 $ make install 367 344 }}} 368 369 345 === Building the game === 370 346 The native library (i.e. the actual game) is built using the standard Premake build system as follows. 371 347 372 ''(Note: You currently need to reset your environment if it is still set up for cross-compiling from the previous section. Close any open terminal windows and open a new one.) 373 '' 348 ''(Note: You currently need to reset your environment if it is still set up for cross-compiling from the previous section. Close any open terminal windows and open a new one.) '''''' 374 349 375 350 Download the game from SVN to any location, e.g.: