Note that there are some explanatory texts on larger screens.

plurals
  1. POOpenGL ES 2.0 Support for Android?
    text
    copied!<p>I've seen multiple takes on this topic and its starting to confuse me. I really hope someone can give me a definitive answer! :)</p> <p>I guess to be blunt: does the Android emulator support OpenGL ES 2.0? I've seen some people say "Yes, but you have to change a few settings." and I've also seen "No, it doesn't support it, period." Here's what I've done to try and correct the problem, including some error messages that I got.</p> <p>First, I modified the AndroidManifest.xml to contain the following code:</p> <pre><code>&lt;uses-feature android:glEsVersion="0x00020000" /&gt; &lt;uses-sdk android:minSdkVersion="15" android:targetSdkVersion="17" /&gt; </code></pre> <p>Then, when I want to instantiate my GLSurfaceView, I use this sequence of code to instantiate it:</p> <pre><code>super(context); setEGLContextClientVersion(2); setRenderer(new MyRenderer()); setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY); </code></pre> <p>Then, everywhere I looked said that you must go into the AVD Manager, select the emulator, go to "Hardware", add "GPU emulation" and set the boolean to "yes". However, here is what I see when I look at mine:</p> <p><img src="https://i.stack.imgur.com/7ZUvi.png" alt="Screenshoot of my Android 4.2 emulator window."></p> <p>What's peculiar is that I have another emulator in my AVD Manager of which I do have the "Hardware" table:</p> <p><img src="https://i.stack.imgur.com/7TY4v.png" alt="What does my Android 2.2 emulator have the hardware table?"></p> <p>And just to show you exactly what I'm doing, here's some code that does some stuff I want to do in OpenGL ES 2.0 (I mainly got this from Android's own tutorials):</p> <pre><code>int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexShaderCode); int fragmentShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentShaderCode); program = GLES20.glCreateProgram(); GLES20.glAttachShader(program, vertexShader); GLES20.glAttachShader(program, fragmentShader); GLES20.glLinkProgram(program); </code></pre> <p>I don't want to change my code back to work with OpenGL ES 1.0 because that will require a lot of headaches and if I can avoid it, I will.</p> <p>Finally, when I try running my program, the program closes with the window: "Unfortunately, has stopped." This is what LogCat told me:</p> <pre><code>12-05 06:16:27.165: E/AndroidRuntime(936): FATAL EXCEPTION: GLThread 81 12-05 06:16:27.165: E/AndroidRuntime(936): java.lang.IllegalArgumentException: No config chosen 12-05 06:16:27.165: E/AndroidRuntime(936): at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:874) 12-05 06:16:27.165: E/AndroidRuntime(936): at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1024) 12-05 06:16:27.165: E/AndroidRuntime(936): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1401) 12-05 06:16:27.165: E/AndroidRuntime(936): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240) </code></pre> <p>I will say I am <em>not</em> an expert on this at all and this is my first experience with OpenGL. If anybody has any ideas of what I can do to fix this, I would be forever grateful. :) Thank you!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload