Game Development Reference
In-Depth Information
Here we set a default value for the
FrameRate
setting of
30
, then limit the value to
just
20
if the game is running on either of the listed Android devices. Quote marks
are only required on device names that contain spaces.
Wondering how to discover the device name? Often it is the name of the device,
but this is not always the case. The easiest way to discover the device name
for a particular device is to create a short test program that makes a call to
s3eDeviceGetString
, as follows:
const char* lpDeviceID = s3eDeviceGetString(S3E_DEVICE_ID);
The
s3eDeviceGetString
function and its sibling
s3eDeviceGetInt
allow us to determine an awful lot of
information about the device we're running on, including the
operating system, processor type, phone number, current language
settings, and much more. Take a look at the
s3eDevice.h
header
file or the Marmalade documentation for more details.
Creating multiple resource sets
Since Marmalade allows us to target so many different devices, it seems a shame to
limit ourselves to a subset of them just because our graphics are too low or too high
resolution for certain devices, or some devices have less memory and therefore can't
handle lots of high resolution textures.
Another issue we might face is that different devices support different file formats
for audio or video clips. To improve render speed and memory usage we might also
consider using hardware texture compression, which of course varies depending on
the type of graphics processor a particular device has.
Marmalade provides a couple of solutions to these problems. The first, more global
approach is to make use of
build styles
, which allow us to both load different sets of
resource files when loading a GROUP file and specify the type of hardware texture
compression to apply.
Build styles are then enhanced by the concept of
resource templates
, which allow us
to more finely control the configuration of resources. Resource templates can be used
to affect the final format of a texture or to modify the way a 3D model is converted
for use in the game, among other things.
Search WWH ::
Custom Search