O'Reilly logo

Marmalade SDK Mobile Game Development Essentials by Sean Scaplehorn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using IwGx to render 2D graphics

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.

IwGx initialization and termination

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.

Rendering a polygon

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required