Index

imageA

Aim control, 219

AL (Audio Library), 269

Android activity, 21, 4344, 46, 64, 81

Android class, 48

Android interface, 131

Android method, 141

Android toolbar, 11

Android Virtual Devices (AVDs), 1014, 16

APK (Application Package), 263

applications

architecture of, 2334

main activity file, 2526

native interface, 2627

native library, 2734

signing, 261263

key store, 262

manually or visually, 262263

testing on device, 3537

architecture, game

for Doom, 151

for Quake, 202216

game startup activity, 214216

handling audio independently of format, 207210

handling keyboard events, 210212

handling touch events, 212214

Java OpenGL renderer architecture, 202207

attaching, to shaders, 119

audio, handling, 3843

for Doom, 164165

for Quake, 207210

Audio Library (AL), 269

AudioManager class, 161, 164

AVDs (Android Virtual Devices), 1014, 16

imageB

Bluetooth controllers, Zeemote joystick, 5358

BluetoothAdapter.getDefaultAdapter( ) method, 58

imageC

C arrays

converting Java arrays to, 268

converting Java string arrays into, 32

C/C++ event handling, Java wrappers for, 3848

cascading video events, 4348

handling audio, 3843

C language

defining variable-arguments functions in, 3334

invoking Java language within, 269

C to Java callbacks, for Doom, 167, 174180

fatal errors, 180

graphics initialization, 174175

sound and music callbacks, 176177

video buffer callback, 176

Call method, 29

callback listener, for Doom, 165166

callbacks, 269

cascading video events, 4348

key events, 46

renderers

mixed or hybrid, 44

Pure Hardware, 4445

Pure Software, 4344

touch events, 4748

cbb.asIntBuffer( ) method, 79

cbb.order.ByteOrder.nativeOrder( ) method, 79

cheat sheets, JNI, 267269

converting Java array to C array, 268

invoking Java language within C language, 269

loading Java class as global reference, 268

method syntax, 268

chooseConfig( ) method, 131

Compilation file, 34

compiling, 1934

Android project with native support, 2122

application architecture, 2334

main activity file, 2526

native interface, 2627

native library, 2734

icosahedron project, 143

with NDK

Doom for Android, 187189

Quake II, 252255

ConfigChooser class, 128

config.getButtonCount( ) method, 57

config.getJoystickCount( ) method, 57

connect( ) method, 56

ContextFactory class, 128

ContextFactory( ) method, 128

controllerUi.startConnectionProcess( ) method, 56

CreateGlEsInterface( ) method, 200

creating AVDs, 1114

Cube class, 75, 7779

cube file, native, 93

Cube( ) method, 76, 78, 86

cube renderers, native, 8793

drawing frames, 8990

Java callback, 9192

native interface function, 9293

scene initialization, 87

Cube_draw( ) method, 8891, 94

CubeRenderer class, 7477

CubeRenderer.drawFrame( ) method, 87, 89

CubeRenderer.surfaceCreated( ) method, 87

Cygwin tool, 10

imageD

development, native, 1958

Bluetooth controllers, Zeemote joystick, 5358

compiling code, 1934

Android project with native support, 2122

application architecture, 2334

Java wrappers for C/C++ event handling, 3848

of audio, 3843

cascading video events, 4348

multitouch schemes, 4853

MultiTouchGesture class, 4850

MultiTouchScreen class, 5051

TestActivity class, 5253

Open GL API, 8098

main activity, 8284

native cube file, 93

native cube renderer, 8793

native interface class, 8485

sample, 8587, 9498

shared library, compiling, 3435

testing app on device, 3537

devices

configuring, 1516

power of, 6061

testing applications on, 3537

Displayed activity, 9798

doNativeDraw( ) method, 86

Doom for Android, 145192

C to Java callbacks, 167, 174180

fatal errors, 180

graphics initialization, 174175

sound and music callbacks, 176177

video buffer callback, 176

changes to game, 181187

commenting SDL occurrences, 182183

inserting fatal error callback, 182

renaming main, 181182

sound system changes, 183

video buffer changes, 184187

compiling with NDK, 187189

game architecture for, 151

handling audio independently of format, 164165

and Java/C combo, 146147

Java main activity, 151163

audio request handlers, 161

creation handler, 152

fatal error handler, 160161

game layout, 152155

graphics initialization handler, 159

image update handler, 159160

key and touch event handlers, 157158

menu and selection handlers, 155156

message updates, 160

navigation controls, 162163

native interface class, 165167

callback listener, 165166

native methods, 166

native method implementations, 170180

key and motion events, 173

native game loop, 171

overview, 149

testing in emulator, 189191

draw( ) method, 66, 78

drawFrame( ) method, 75, 8687, 8990, 93

drawing, zooming and, 107111

imageE

EAS (Enhanced Audio System), 269

Eclipse platform, configuring, 29

e.getAction( ) method, 50, 139, 212

e.getPointerCount( ) method, 5051, 139

e.getX( ) method, 212

e.getY( ) method, 212

EGL (Embedded OpenGL), 72

eglChooseConfig( ) method, 121

EGLContext class, 80

EGLContext.getEGL( ) method, 80

egl.eglGetError( ) method, 129

EglHelper( ) method, 73

Embedded OpenGL (EGL), 72

Embedded System (ES), 60

emulators

overview, 189191

running in Quake II, 255258

Enhanced Audio System (EAS), 269

environments, 117

AVDs, 1014

devices, configuring, 1516

Eclipse platform, configuring, 29

NDK, installing, 910

SDK, downloading and installing, 2

setting up machine, 12

e.printStackTrace( ) method, 25, 68, 82

ES (Embedded System), 60

ES interface, 201

e.toString( ) method, 40, 157158, 161, 163, 168, 211

event.getAction( ) method, 47, 158

event.getButtonID( ) method, 57

event.getController( ) method, 5657

event.getCurrentLevel( ) method, 56

event.getMaximumLevel( ) method, 56

event.getMinimumLevel( ) method, 56

event.getWarningLevel( ) method, 56

evt.getAction( ) method, 162164

ex.printStackTrace( ) method, 73

imageF

fatal errors, handling for Quake II, 245248

FPS (frames per second), 45

Fragment Shader Language (FSL), 115117

fragment shaders, 114

frames, drawing, 8990

frames per second (FPS), 45

FSL (Fragment Shader Language), 115117

imageG

game architecture

for Doom, 151

for Quake, 202216

game startup activity, 214216

handling audio independently of format, 207210

handling keyboard events, 210212

handling touch events, 212214

Java OpenGL renderer architecture, 202207

Game file, 149, 156

game layout, for Doom, 152155

GameFileDownloader class, 151

G_CheckDemoStatus( ) method, 182

geometry shaders, 115

getConfigSpec( ) method, 7576

geteuid( ) method, 239

getEvent( ) method, 73

getHolder( ) method, 6869, 71

getSurfaceHolder( ) method, 69

getWindow( ) method, 52, 152, 215

getWindowManager( ) method, 52, 127, 215

glClear( ) method, 76, 8990

glCreateProgram( ) method, 118, 135136

glEnableClientState( ) method, 89

GLES interface, 197

glFlush( ) method, 218

gl.glLoadIdentity( ) method, 74, 7677, 89

glLoadIdentity( ) method, 74, 8990

global references, loading Java classes as, 268

gl*Pointer( ) method, 78

GLSL (OpenGL ES 2.0 Shading Language), 115

GLSwapBuffers( ) method, 8485, 87

GLThread class, 7174

GLThread.surfaceCreated( ) method, 68

GLThread.surfaceDestroyed( ) method, 69

gl_unimplemented( ) method, 197

GPU (Graphics Processing Unit), 43, 60

g.reset( ) method, 51

guardedRun( ) method, 7173

imageH

handling audio, 3843

for Doom, 164165

for Quake, 207210

hybrid renderers, 44

hybrid scaling, with Open GL API, 99111

drawing into texture, 103106

initializing surface, 102

reasons for, 99102

when image is not power of two, 106111

imageI

I (integer), 31

icosahedron project, 121139

activity, 127

compiling, 143

configuration chooser, 131133

manifest, 126127

pinching to zoom, 139142

project shaders, 134

scene initialization, 135137

scene rendering, 137138

setting rotation speed, 138139

shape defined, 121123

surface renderer, 130131

surface view, 128129

swiping to change rotation speed, 139142

images, hybrid scaling when not power of two, 106111

ImageView.getLayoutParams( ) method, 159

immediate mode drawing, OpenGL ES vs. OpenGL, 195196

init( ) method, 69

InitGLStructs( ) method, 197, 199

init_scene( ) method, 87, 93

integer (I), 31

I_ShutdownGraphics( ) method, 182

isRunning( ) method, 4041

item.getItemId( ) method, 156

imageJ

jargon, for Quake, 193194

Java activity, 21, 47, 58, 82

Java arrays

converting string of into C array, 32

converting to C array, 268

getting size of, 33

Java/C combo, and Doom for Android, 146147

Java callbacks, 9192

Java class, 20, 27, 40, 61, 92, 180, 221, 236, 247, 268

Java heap, and Quake II, 234235

Java language

invoking static void method, 33

invoking within C language, 269

Open GL API in, 6179

Cube class, 7779

CubeRenderer class, 7477

example project, 6266

GLThread class, 7174

Java main activity, 6768

Surface View class, 6871

Java main activity, for Doom, 151163

audio request handlers, 161

creation handler, 152

fatal error handler, 160161

game layout, 152155

graphics initialization handler, 159

image update handler, 159160

key and touch event handlers, 157158

menu and selection handlers, 155156

message updates, 160

navigation controls, 162163

Java method, 19, 23, 33, 46, 89, 103, 169, 176, 237, 245

Java Native Interface. See JNI

Java Virtual Machine (JVM), 30

Java wrappers, for C/C++ event handling, 3848

of audio, 3843

cascading video events, 4348

JavaGLActivity.onCreate( ) method, 67

JIT (Just in Time), 38

JNI class, 43, 176

JNI (Java Native Interface), cheat sheet, 267269

converting Java array to C array, 268

invoking Java language within C language, 269

loading Java class as global reference, 268

method syntax, 268

JNI method, 92, 178, 255

jni.Natives.LibMain( ) method, 33

jni.Natives.OnMessage( ) method, 37

Just in Time (JIT), 38

JVM (Java Virtual Machine), 30

imageK

key events, 46

key stores, 262

imageL

libraries

compiling shared, 3435

native, 2734

listener.GLSwapBuffers( ) method, 85

loading, shaders, 118119

imageM

MAC (message authentication code), 54

main activity

files, 2526

Java, 6768

Open GL API, 8284

main( ) method, 31, 181

mEglHelper.finish( ) method, 7374

mEglHelper.swap( ) method, 74, 87

message authentication code (MAC), 54

method syntax, JNI, 268

mGLSurfaceView.onPause( ) method, 68, 83

mGLSurfaceView.onResume( ) method, 68, 83

mGLThread.onPause( ) method, 70

mGLThread.onResume( ) method, 70

mGLThread.requestExitAndWait( ) method, 71

mGLThread.start( ) method, 7071, 86

mGLThread.surfaceCreated( ) method, 70

mGLThread.surfaceDestroyed( ) method, 70

mixed renderers, 44

MotionEvent type, 141

mRenderer.getConfigSpec( ) method, 73

mTrack.play( ) method, 40, 208

multitouch schemes, 4853

MultiTouchGesture class, 4850

MultiTouchScreen class, 5051

TestActivity class, 5253

MultiTouchGesture class, 4850

MultiTouchGesture.eGestureType type, 49

MultiTouchScreen class, 5052

mView.getLayoutParams( ) method, 159

MyApp( ) method, 20

imageN

NanoGL, for Quake, 197202

NanoGL interface, 200

nanoGL_Destroy( ) method, 199200

nanoGL_Init( ) method, 199200, 217, 249

Native activity, 83

native cube file, 93

native cube renderers, 8793

drawing frames, 8990

Java callback, 9192

native interface function, 9293

scene initialization, 87

native development, 1958

Bluetooth controllers, Zeemote joystick, 5358

compiling code, 1934

Android project with native support, 2122

application architecture, 2334

Java wrappers for C/C++ event handling, 3848

of audio, 3843

cascading video events, 4348

multitouch schemes, 4853

MultiTouchGesture class, 4850

MultiTouchScreen class, 5051

TestActivity class, 5253

Open GL API, 8098

main activity, 8284

native cube file, 93

native cube renderer, 8793

native interface class, 8485

sample, 8587, 9498

shared library, compiling, 3435

testing app on device, 3537

Native Development Kit (NDK), installing, 910

native interface class

for Doom, 165167

callback listener, 165166

native methods, 166

overview, 8485

native interface function, 9293

native interfaces, 2627

native libraries, 2734

defining variable-arguments function in C language, 3334

invoking Java static void method, 33

Java arrays

converting string of into C array, 32

getting size of, 33

Native method, 169

NativeAudio class, 209

NativeAudio.start( ) method, 204, 209, 245, 252

NativeRender( ) method, 8485

Natives class, 28, 30, 33, 91, 170171, 205

Natives.EventListener interface, 158

Natives.java class, 237

Natives.NativeRender( ) method, 86

Natives.OnMessage method, 33

Natives.RenderFrame( ) method, 203

navigation controls, for Doom, 162163

NDK, compiling with, Doom for Android, 187189

NDK (Native Development Kit), installing, 910

imageO

OnCloseAudio( ) method, 40, 42

onCreate( ) method, 72, 152

onDestroy( ) method, 72

onDetachedFromWindow( ) method, 7071

OnImageUpdate( ) method, 172

OnLockAudio( ) method, 4041

onPause( ) method, 68, 70, 83

onResume( ) method, 68, 70, 83

OnUnLockAudio( ) method, 41

Open GL API

hybrid scaling with, 99111

drawing into texture, 103106

initializing surface, 102

reasons for, 99102

when image is not power of two, 106111

in Java language, 6179

Cube class, 7779

CubeRenderer class, 7477

example project, 6266

GLThread class, 7174

Java main activity, 6768

Surface View class, 6871

native development, 8098

main activity, 8284

native cube file, 93

native cube renderer, 8793

native interface class, 8485

sample, 8587, 9498

power of devices, 6061

OpenGL ES

vs. OpenGL, 195196

floating point issues, 196

immediate mode drawing, 195196

OpenGL ES 1.x, vs. OpenGL ES 2.0, 120121

OpenGL ES 2.0, 113120

fragment shaders, 114

FSL, 115117

geometry shaders, 115

GLSL, 115

icosahedron project, 121139

activity, 127

compiling, 143

configuration chooser, 131133

manifest, 126127

pinching to zoom, 139142

project shaders, 134

scene initialization, 135137

scene rendering, 137138

setting rotation speed, 138139

shape defined, 121123

surface renderer, 130131

surface view, 128129

swiping to change rotation speed, 139142

vs. OpenGL ES 1.x, 120121

shaders, 114120

attaching to shader, 119

creating program, 117118

getting link status, 119

linking shader program, 119

loading shader, 118119

program validation and status, 120

using program, 120

vertex shaders, 114

VSL, 115

OpenGL ES 2.0 Shading Language (GLSL), 115

OpenGL immediate mode, and Quake II, 248

OpenGL interface, 200

opengl.jni.Natives.NativeRender( ) method, 92

imageP

performance, of Quake II, 258259

pinching to zoom, icosahedron project, 139142

PixelFormat class, 69

preloadSounds( ) method, 164

projects, icosahedron, 121139

activity, 127

compiling, 143

configuration chooser, 131133

manifest, 126127

pinching to zoom, 139142

project shaders, 134

scene initialization, 135137

scene rendering, 137138

setting rotation speed, 138139

shape defined, 121123

surface renderer, 130131

surface view, 128129

swiping to change rotation speed, 139142

Pure Hardware renderers, 4445

Pure Software renderer, 4344

imageQ

qglFlush( ) method, 252

Quake for Android, 193232

changes to game, 216225

audio handler changes, 220221

fixing game loop, 223225

handling forward and side movement, 220

handling pitch and yaw, 219220

video handler changes, 216218

game architecture, 202216

game startup activity, 214216

handling audio independently of format, 207210

handling keyboard events, 210212

handling touch events, 212214

Java OpenGL renderer architecture, 202207

jargon for, 193194

NanoGL for, 197202

OpenGL vs. OpenGL ES, 195196

floating point issues, 196

immediate mode drawing, 195196

running on device, 225229

Quake II for Android, 233260

code reusability, 236245

audio handling, 243245

game startup, 237238

handling key events, 241

moving in 3D space, 241243

rendering single frame, 238241

compiling with NDK, 252255

handling fatal errors, 245248

and Java heap needed, 234235

OpenGL immediate mode issues, 248

performance of, 258259

running on device or emulator, 255258

video handlers, 248252

setting video mode and size, 249252

video initialization, 249

when rendering completes, 252

QuakeRenderer( ) method, 203

QuakeView class, 248, 255

imageR

Renderer interface, 6364, 67, 74

renderers

mixed or hybrid, 44

Pure Hardware, 4445

Pure Software, 4344

RenderFrame( ) method, 205206, 224225, 237240

requestFocus( ) method, 203

reset( ) method, 49

r.run( ) method, 73

run( ) method, 40, 46, 72, 129, 160161, 208, 210212

Runnable( ) method, 40, 46, 129, 160161, 208, 210212

running

on device, Quake II, 255258

in emulator, Quake II, 255258

Quake for Android, 225229

imageS

scaling, hybrid, 99111

drawing into texture, 103106

initializing surface, 102

reasons for, 99102

when image is not power of two, 106111

scenes, initializing, 87

SD Card, 13

SDKs (Software Development Kits), downloading and installing, 2

sEglSemaphore.acquire( ) method, 7172

sEglSemaphore.release( ) method, 71, 73

seteuid.getuid( ) method, 239

setGameUI( ) method, 152

setRenderer( ) method, 71

setupPanControls( ) method, 152, 163

shaders, 114120

attaching to, 119

creating program, 117118

getting link status, 119

linking program, 119

loading, 118119

program validation and status, 120

using program, 120

ShadersActivity class, 139

ShadersView object, 127

Software Development Kits (SDKs), downloading and installing, 2

start( ) method, 208209

static void method, Java language, invoking, 33

stop( ) method, 39, 4142

string arrays, Java, converting into C array, 32

super( ) method, 72

super.onDetachedFromWindow( ) method, 70

super.onPause( ) method, 68, 83

super.onResume( ) method, 68, 83

Surface View class, 6871

surfaceCreated( ) method, 69

SurfaceHolder.addCallback( ) method, 68

surfaces, initializing, 102

swapBuffers( ) method, 74

SysError( ) method, 206

System class, 207

System.currentTimeMillis( ) method, 130

imageT

TestActivity class, 5253

testing in emulator, Doom for Android, 189191

textures, drawing into, 103106

touch events, 4748

t.start( ) method, 41

imageU

UI (user interface), 192

USB driver, 1516

user interface (UI), 192

imageV

variable-arguments functions, defining in C language, 3334

vbb.asIntBuffer( ) method, 79

vbb.order.ByteOrder.nativeOrder( ) method, 78

Vertex Shader Language (VSL), 115

vertex shaders, 114

video, cascading events, 4348

key events, 46

renderers, 4345

touch events, 4748

video handlers, for Quake II, 248252

setting video mode and size, 249252

video initialization, 249

when rendering completes, 252

View.OnTouchListener( ) method, 162163

ViewRenderer( ) method, 128129

VSL (Vertex Shader Language), 115

imageW

wait( ) method, 73

imageX, Y

XML file, 126

imageZ

zee.connect( ) method, 58

Zeemote class, 58

Zeemote joystick, 5358

zooming, and drawing, 107111

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.77.30