O'Reilly logo

OpenGL ES 2 for Android by Kevin Brothaler

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

Understanding Textures

Textures in OpenGL can be used to represent images, pictures, and even fractal data that are generated by a mathematical algorithm. Each two-dimensional texture is composed of many small texels, which are small blocks of data analogous to the fragments and pixels that we’ve talked about previously. The most common way to use a texture is to load in the data directly from an image file.

We’ll use the image in Figure 36, The Surface Image as our new air hockey table surface and load it in as a texture:

images/Textures/AirHockeySurface.png
Figure 36. The Surface Image

All of the images used in the code can be downloaded from this book’s home page. I recommend ...

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