Game Development Reference
In-Depth Information
Value
Description
ATITC
Will compress textures using ATI compression. Automatically uses 4-bit
compression on textures with no alpha channel, or 8-bit compression
on textures with transparency. Supported on ATI/Qualcomm chipsets
typically used in many Android devices.
ETC
Uses 4-bit Ericsson texture compression on textures with no alpha
channel. Transparent textures cannot be compressed. Supported on ATI/
Qualcomm chipsets and most chipsets that support OpenGL ES 2.x.
DXT1 ,
DXT3 , and
DXT5
DXT1 compression is a 4-bit format used for non-transparent textures.
DXT3 is an 8-bit format that allows transparent textures to be compressed.
DXT5 is another 8-bit format that has better support for gradients in
the alpha channel. If DXT3 or DXT5 is specified and an opaque texture
is encountered, Marmalade will automatically use DXT1 compression
instead. Available on NVidia Tegra2 chipset devices.
Specifying which build style to use
With our build styles declared, we now just need to let Marmalade know which
of them to use when loading resources. The easiest way of doing this is to use the
ResBuildStyle ICF setting, which we do by adding the following to our ICF file:
[RESMANAGER]
ResBuildStyle=pvrtc
We can also switch between build styles at runtime as the resource manager
provides methods for us to set and get the current build style. The following code
snippets illustrate this:
// Discover the currently selected build style
CIwStringL lCurrentStyle = IwGetResManager()->
GetBuildStyleCurrName();
// To change to a different build style
IwGetResManager()->SetBuildStyle("atitc");
Bear in mind, however, that while it is easy to switch between build styles, this
behavior is only supported in Windows debug builds. When we create a release
build for devices, we will generally only provide the resources required for that
device type in order to reduce the size of the installation package. We'll be looking
at how to achieve this later in this chapter.
Search WWH ::




Custom Search