O'Reilly logo

Mastering Android NDK by Viktor Latypov, Sergey Kosarevsky

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

Chapter 7. Cross-platform UI and Input System

In the previous chapter, we introduced classes and interfaces for platform-independent rendering. Here, we make a slight detour on our way to a 3D OpenGL renderer and use the SDL library to render elements of the user interface. To render our UI, we need lines, rectangles, textured rectangles, and text strings.

We will begin this chapter with the description of the iCanvas interface designed to render geometric primitives. The most complex part of iCanvas is Unicode text rendering, which is implemented using the FreeType library. Font glyphs caching is also a very important topic for complex UIs, which is discussed here. The second part of the chapter describes a multipage graphical user interface suitable ...

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