summaryrefslogtreecommitdiffstats
path: root/docs/html/guide/topics/graphics/opengl.jd
blob: 9f889543d5dcaca4ae9e3f5a13f96b6b579a4935 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
page.title=3D with OpenGL
parent.title=Graphics
parent.link=index.html
@jd:body


<p>Android includes support for high performance 3D graphics 
via the OpenGL API&mdash;specifically, the OpenGL ES API.</p>

<p>OpenGL ES is a flavor of the OpenGL specification intended for embedded devices. Versions of <a
href="http://www.khronos.org/opengles/">OpenGL ES</a> are loosely peered to versions of the primary
OpenGL standard. Beginning with Android 2.2, the platform supports OpenGL ES 2.0 (with
backward compatibility support for OpenGL ES 1.1). For information about the relative number of
Android-powered devices that support a given version of OpenGL ES, see the <a
href="http://developer.android.com/resources/dashboard/opengl.html">OpenGL ES Versions</a>
dashboard.</p>

<p>The specific API provided by Android is similar to the J2ME JSR239 OpenGL
ES API. However, it may not be identical, so watch out for deviations.</p>

<h2>Using the API</h2>

<p>Here's how to use the API at an extremely high level:</p>

<ol>
<li>Write a custom {@link android.view.View} subclass.</li>
<li>Obtain a handle to an OpenGLContext, which provides access to the OpenGL functionality.</li>
<li>In your View's {@link android.view.View#onDraw onDraw()} method, get a handle to a GL object,
and use its methods to perform GL operations.</li>
</ol>

<p>Several samples using OpenGL ES are available in the <a
href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/index.html">API
Demos</a> sample application.
</p>

<p>A summary of how to actually write 3D applications using OpenGL is
beyond the scope of this text and is left as an exercise for the reader.</p>

<h2>Links to Additional Information</h2>

<p>Information about OpenGL ES can be
found at <a title="http://www.khronos.org/opengles/"
href="http://www.khronos.org/opengles/">http://www.khronos.org/opengles/</a>.</p> 

<p>Information specifically
about OpenGL ES 1.0 (including a detailed specification) can be found
at <a title="http://www.khronos.org/opengles/1_X/"
href="http://www.khronos.org/opengles/1_X/">http://www.khronos.org/opengles/1_X/</a>.</p>

<p>The documentation for the Android OpenGL ES implementations are available in {@link
android.opengl} and {@link javax.microedition.khronos.opengles}.</p>