Game Development Reference
In-Depth Information
The Iw2D API
Given that this is a chapter about 2D graphics rendering, the Iw2D API must surely
be the way to go, right?
Well, yes and no. It certainly has a lot going for it, like the following:
• It provides us with the ability to render flat shaded primitives such as lines,
arcs, rectangles, and polygons, either as outlines or filled shapes.
• It allows us to easily load bitmapped images and render them on screen and
also apply scaling or rotational transforms to those images.
• It makes it easy for us to draw text on screen that looks substantially better
than the default debug font we've currently seen.
• It provides certain optimizations that allow us to speed up rendering. For
example, it can batch together several requests to draw a particular image into
a single call, which can yield good performance increases on many devices.
However, as you've probably already inferred from the tone of this section, we won't
be using Iw2D in this topic either.
If you are only interested in rendering 2D graphics, Iw2D may well be perfectly
adequate for your needs, but if you ever want to make the jump to 3D graphics you
will eventually find that the Iw2D API just doesn't do everything you need, such as
rendering textured polygons of any shape, not just rectangular.
Since we will be tackling 3D graphics later in this very book, it makes sense for us to
begin our journey into rendering with Marmalade by using 3D graphics itself.
If you want to use this API in your own project, just add iw2d to the subprojects
section of the MKB file.
The IwGx API
Finally we come to the API that we will be using in this topic; in fact we have already
used a very small part of it in the creation of our "Hello World" project. Ladies and
gentlemen, I give you the IwGx API!
This API is extremely flexible and boasts the following functionalities:
• It supports both hardware and software rendering pipelines, so your code
can potentially run unaltered on modern hardware featuring a GPU yet still
fall back to a software-based renderer for older or less capable hardware. You
can even mix the two pipelines, so you could use the GPU for rasterization
but still use the CPU for transform and lighting operations.
 
Search WWH ::




Custom Search