Game Development Reference
In-Depth Information
heavy tasks that would not be as well suited to the Dalvik VM, such as graphics rendering,
audio playback, and database access. The APIs are wrapped by Java classes in the application
framework, which you'll exploit when you start writing your games. You'll use the following
libraries in one form or another:
Skia Graphics Library (Skia) : This 2D graphics software is used for rendering the
UI of Android applications. You'll use it to draw your first 2D game.
OpenGL for Embedded Systems (OpenGL ES) : This is the industry standard for
hardware-accelerated graphics rendering. OpenGL ES 1.0 and 1.1 are exposed
to Java on all versions of Android. OpenGL ES 2.0, which brings shaders to
the table, is only supported from Android 2.2 (Froyo) onward. It should be
mentioned that the Java bindings for OpenGL ES 2.0 in Froyo are incomplete
and lack a few vital methods. Fortunately, these methods were added in version
2.3. Also, many older emulator images and devices, which still make up a small
share of the market, do not support OpenGL ES 2.0. For your purposes, stick
with OpenGL ES 1.0 and 1.1, to maximize compatibility and allow you to ease
into the world of Android 3D programming.
OpenCore : This is a media playback and recording library for audio and video. It
supports a good mix of formats such as Ogg Vorbis, MP3, H.264, MPEG-4, and
so on. You'll mostly deal with the audio portion, which is not directly exposed to
the Java side, but rather wrapped in a couple of classes and services.
FreeType : This is a library used to load and render bitmap and vector fonts,
most notably the TrueType format. FreeType supports the Unicode standard,
including right-to-left glyph rendering for Arabic and similar special text. As with
OpenCore, FreeType is not directly exposed to the Java side, but is wrapped in
a couple of convenient classes.
These system libraries cover a lot of ground for game developers and perform most of the heavy
lifting. They are the reason why you can write your games in plain old Java.
Note Although the capabilities of Dalvik are usually more than sufficient for your purposes,
at times you might need more performance. This can be the case for very complex physics
simulations or heavy 3D calculations, for which you would usually resort to writing native code.
We'll look into this in a later chapter of the topic. A couple of open source libraries for Android
already exist that can help you stay on the Java side of things. See
http://code.google.com/p/libgdx/ for an example.
 
 
Search WWH ::




Custom Search