Now that we know how to load resources, we can get on with the fun stuff. We're going to look at how we can draw a bitmapped image on screen.
We've already seen how to do this in the "Hello World" project of Chapter 1, Getting Started with Marmalade. We just call IwGxInit
to set up IwGx at the start of our program and IwGxTerminate
to close it down again at the end.
In IwGx, the most commonly used polygon types are lines, triangles, and quads (basically two triangles that share a common edge).
Also supported are sprites, which are always rectangular in shape and do not allow any scaling of textures, and n-polys, which can contain up to 63 vertices.
Sprites are rarely used since triangles and quads are more flexible, though they can be faster to draw especially in software rendering mode. The n-poly can also be faster to draw for the software renderer than a series of triangles, but they are generally best...