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

A Review

We now know how to load in a texture and display it on our air hockey table; we’ve also learned how to reorganize our program so that we can easily switch between multiple shader programs and vertex arrays in our code. We can adjust our textures to fit the shape they’re being drawn on, either by adjusting the texture coordinates or by prestretching or squashing the texture itself.

Textures don’t get drawn directly—they get bound to texture units, and then we pass in these texture units to the shaders. We can still draw different textures in our scene by swapping them in and out of texture units, but excessive swapping may degrade performance. We can also use more than one texture unit to draw several textures at the same time.

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