OpenGL ES 2.0 on OUYA?

Hey guys, I'm having a bit of a problem enabling OpenGL ES 2.0 on my OUYA, and since it didnt look like anyone else had posted about it, I figured I'd ask.

So I have a simple GLSurfaceView called mySurface, and I'm calling setEGLContextClientVersion like so:
mySurface.setEGLContextClientVersion(2);

When I do this, LogCat fills with hundreds of the same error:
06-05 13:46:48.963: E/libEGL(1089): called unimplemented OpenGL ES API
And none of my drawing calls work. However, everything seems to work when I call
mySurface.setEGLContextClientVersion(1);

Normally, I would just assume that OUYA doesn't support 2.0 and move on with my life, but when I query the supported ES version using:
final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
System.out.println(configurationInfo.reqGlEsVersion >= 0x20000);

I get "true", which apparently means that 2.0 is supported. I've tried adding
<uses-feature android:glEsVersion="0x00020000"></uses-feature>
to the manifest, and even
android:hardwareAccelerated="false"
(I don't know! Someone on the Internet told me it helped!)

Anyway, has anyone else run into this issue? Is there a workaround or should I just wait for the next system update?

Comments

  • WildsWilds Posts: 78Member
    I have been building a framework for OUYA game creation.
    Maybe you can find the problem by looking at my source code.
  • SpoonThumbSpoonThumb Posts: 426Member
    Have you tried simply omitting the suspect call? I suspect you don't need to set it (though I myself use OpenGL 1.1 :P so I'm by no means an expert)
  • ShushShush Posts: 178Member
    Here's what I use, which works fine on the OUYA and multiple Android devices.

        setEGLContextFactory(new ContextFactory());


        private static class ContextFactory implements GLSurfaceView.EGLContextFactory {
            private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
            public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
                Log.w(TAG, "creating OpenGL ES 2.0 context");
                checkEglError("Before eglCreateContext", egl);
                int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
                EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
                checkEglError("After eglCreateContext", egl);
                return context;
            }
       
            public void destroyContext(EGL10 egl, EGLDisplay display, EGLContext context) {
                egl.eglDestroyContext(display, context);
            }
        }

  • redsoxfantomredsoxfantom Posts: 4Member
    Hmmm, that doesn't seem to work for me, Shush. I'm getting the same error.

    Maybe it has something to do with the EGL_CONTEXT_CLIENT_VERSION? Where did you come up with the value for that? I'll mess around with it and see if that fixes anything.

    Thanks for the help though!
Sign In or Register to comment.