Surface View in droid game

The class GLSurfaceView (see Listing 3–3) defines the surface where the tumbling cubes animation will take place. The class constructor starts by initializing a callback to receive notifications when the surface is changed, created, or destroyed: mHolder = getHolder(); mHolder.addCallback(this); mHolder.setType(SurfaceHolder.SURFACE_TYPE_GPU); By implementing SurfaceHolder.Callback and calling SurfaceHolder ...

Read more

OpenGL the Java Way in android game

Let’s look at how OpenGL graphics are done in Java. We’ll start by creating a project for our sample application. Then we’ll look at the classes that make up the project: The main activity used to launch the app, the surface view used to render graphics, the GL thread used to perform drawing operations in the background, the cube renderer used to draw the actual cube, and the cube class which has informatio ...

Read more

The Power of Mobile Devices in android

Mobile Android devices have become pretty powerful for graphics development. Check out the following hardware stats for the Samsung Galaxy S:  ARM processor running at 1 GHz   Graphics processing unit (GPU) with 256 KB of RAM   320x480 pixel display To make good use of the GPU, Google has included the OpenGL Embedded System (ES) within Android. OpenGL ES provides the software API to make high-performance ...

Read more

Bluetooth Controllers (Zeemote) in android game

Zeemote is a Bluetooth joystick controller very popular in Nokia phones. With the rising in popularity of other smartphones, its creators released an SDK for other platforms such as Android and iPhone. The Zeemote consists of a joystick and four buttons (A, B, C, and D - see Figure 2–10). Figure 2–10. Bluetooth settings and Zemmote joystick  Before you can start using a Zeemote you need to turn it on, enabl ...

Read more

Cascading Key Events in android game

Cascading key events from Android to a native engine involves the following steps: 1. Listening for key presses or releases from the Android activity. 2. Translating the android keys to ASCII (or whatever format the engine uses to encode keys). 3. Calling the native methods keyPress or keyrelease for presses and releases respectively. Note that Android uses its own format to encode key values; thus the tric ...

Read more
Scroll to top