Displaying graphics with OpenGL ES
Stay organized with collections
Save and categorize content based on your preferences.
The Android framework provides plenty of standard tools for creating attractive, functional
graphical user interfaces. However, if you want more control of what your application draws on
screen, or are venturing into three dimensional graphics, you need to use a different tool. The
OpenGL ES APIs provided by the Android framework offers a set of tools for displaying high-end,
animated graphics that are limited only by your imagination and can also benefit from the
acceleration of graphics processing units (GPUs) provided on many Android devices.
This class walks you through the basics of developing applications that use OpenGL, including
setup, drawing objects, moving drawn elements and responding to touch input.
The example code in this class uses the OpenGL ES 2.0 APIs, which is the recommended API version
to use with current Android devices. For more information about versions of OpenGL ES, see the
OpenGL developer
guide.
Note: Be careful not to mix OpenGL ES 1.x API calls with OpenGL
ES 2.0 methods! The two APIs are not interchangeable and trying to use them together only results in
frustration and sadness.
Lessons
- Build an OpenGL ES environment
- Learn how to set up an Android application to be able to draw OpenGL graphics.
- Define shapes
- Learn how to define shapes and why you need to know about faces and winding.
- Draw shapes
- Learn how to draw OpenGL shapes in your application.
- Apply projection and camera views
- Learn how to use projection and camera views to get a new perspective on your drawn
objects.
- Add motion
- Learn how to do basic movement and animation of drawn objects with OpenGL.
- Respond to touch events
- Learn how to do basic interaction with OpenGL graphics.
Additional sample code
To download NDK samples, see
NDK Samples.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-02-22 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-02-22 UTC."],[],[],null,["# Displaying graphics with OpenGL ES\n\nThe Android framework provides plenty of standard tools for creating attractive, functional\ngraphical user interfaces. However, if you want more control of what your application draws on\nscreen, or are venturing into three dimensional graphics, you need to use a different tool. The\nOpenGL ES APIs provided by the Android framework offers a set of tools for displaying high-end,\nanimated graphics that are limited only by your imagination and can also benefit from the\nacceleration of graphics processing units (GPUs) provided on many Android devices.\n\nThis class walks you through the basics of developing applications that use OpenGL, including\nsetup, drawing objects, moving drawn elements and responding to touch input.\n\nThe example code in this class uses the OpenGL ES 2.0 APIs, which is the recommended API version\nto use with current Android devices. For more information about versions of OpenGL ES, see the\n[OpenGL developer\nguide](/develop/ui/views/graphics/opengl/about-opengl#choosing-version).\n\n**Note:** Be careful not to mix OpenGL ES 1.x API calls with OpenGL\nES 2.0 methods! The two APIs are not interchangeable and trying to use them together only results in\nfrustration and sadness.\n\nLessons\n-------\n\n**[Build an OpenGL ES environment](/develop/ui/views/graphics/opengl/environment)**\n: Learn how to set up an Android application to be able to draw OpenGL graphics.\n\n**[Define shapes](/develop/ui/views/graphics/opengl/shapes)**\n: Learn how to define shapes and why you need to know about faces and winding.\n\n**[Draw shapes](/develop/ui/views/graphics/opengl/draw)**\n: Learn how to draw OpenGL shapes in your application.\n\n**[Apply projection and camera views](/develop/ui/views/graphics/opengl/projection)**\n: Learn how to use projection and camera views to get a new perspective on your drawn\n objects.\n\n**[Add motion](/develop/ui/views/graphics/opengl/motion)**\n: Learn how to do basic movement and animation of drawn objects with OpenGL.\n\n**[Respond to touch events](/develop/ui/views/graphics/opengl/touch)**\n: Learn how to do basic interaction with OpenGL graphics.\n\nAdditional sample code\n----------------------\n\nTo download NDK samples, see\n[NDK Samples](https://github.com/googlesamples/android-ndk/)."]]