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

Chapter 5Adjusting to the Screen’s Aspect Ratio

You might not have noticed it yet, but we currently have an aspect ratio problem with our air hockey table. To see what’s happening, open the latest project from the previous chapter and go ahead and run the app on your device or in the emulator. Once it’s running, rotate your device from portrait to landscape (if using the emulator, press CTRL-F12).

The app should look like the next figure in portrait mode, and the subsequent figure in landscape mode:

images/AspectRatio/airHockeyPortrait.png
Figure 20. Air hockey in portrait
images/AspectRatio/airHockeyLandscape.png
Figure 21. Air ...

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